about summary refs log tree commit diff stats
path: root/src/ui/window.c
Commit message (Expand)AuthorAgeFilesLines
* Merge pull request #874 from spiridoncha/masterMichael Vetter2019-10-051-1/+9
|\
| * Makes /clear behavior configurable.Spiridonov Alexander2016-11-071-0/+5
| * Change /clear behaviour. Closes issue #855.Spiridonov Alexander2016-10-221-1/+4
* | Allow colorization of history messagesMichael Vetter2019-09-101-2/+2
* | Remove dead assignmentsMichael Vetter2019-07-221-1/+1
* | Rename prof_message_t into ProfMessagePaul Fariello2019-06-201-1/+1
* | Set foreground color for untrusted messagesPaul Fariello2019-06-201-6/+5
* | Add prof_message_t to wrap all message attributesPaul Fariello2019-06-201-14/+13
* | Use flags in xmmp/message.c for encryption and trustPaul Fariello2019-06-201-2/+12
* | Rework MUC reflected message filteringPaul Fariello2019-04-101-0/+1
* | Log and print outgoing encrypted messagePaul Fariello2019-04-101-0/+1
* | Add OMEMO message encryption and decryptionPaul Fariello2019-04-101-0/+2
* | Move OMEMO initialization to profanity intializationPaul Fariello2019-04-101-0/+1
* | Update copyright to include 2019Michael Vetter2019-01-221-1/+1
* | Fix command exec error outputPaul Fariello2018-09-051-1/+1
* | Add support for command config executionPaul Fariello2018-09-051-1/+2
* | Add conf win callbackPaul Fariello2018-09-051-1/+10
* | Rename mucconf wins into conf winsPaul Fariello2018-09-051-17/+17
* | Add command exec error handlingPaul Fariello2018-09-051-0/+15
* | Handle simple executionPaul Fariello2018-09-051-0/+7
* | Add command subcommands: list and execPaul Fariello2018-09-051-0/+28
* | Add preferences for tab displayJames Booth2018-03-091-14/+45
* | Add prefs for empty tabs and tab namesJames Booth2018-03-081-2/+5
* | Show name in statusbar tabs WIPJames Booth2018-03-081-3/+11
* | Update copyrightJames Booth2018-01-211-1/+1
* | Update CopyrightJames Booth2017-01-281-1/+1
* | Allow room display properies to be set by pluginsJames Booth2017-01-201-8/+12
* | Allow chat prefix char to be set by pluginsJames Booth2017-01-201-1/+10
* | Add titlebar encryption text to plugins apiJames Booth2017-01-191-0/+2
* | Remove unused functionJames Booth2016-11-241-10/+0
|/
* Rename buffer functionsJames Booth2016-10-161-16/+16
* Fix win_append buffer pushJames Booth2016-10-151-1/+1
* Add win highlight fuctionsJames Booth2016-10-151-19/+107
* Use varargs in win_println_indentJames Booth2016-10-151-6/+20
* Add win_print_historyJames Booth2016-10-151-0/+20
* Rename win_print_incoming_message -> win_print_incomingJames Booth2016-10-151-1/+1
* Add win_print_outgoingJames Booth2016-10-151-0/+20
* Add win_appendJames Booth2016-10-151-31/+50
* Add win_appendlnJames Booth2016-10-151-15/+33
* Add win_printJames Booth2016-10-151-15/+35
* Rename win_println -> win_println_indentJames Booth2016-10-151-1/+1
* Remove win_vprintln_chJames Booth2016-10-151-12/+0
* Remove whitespaceJames Booth2016-10-151-1/+0
* Rename win_get_string -> win_to_stringJames Booth2016-10-151-1/+1
* Use win_printf_line where appropriateJames Booth2016-10-151-4/+4
* Add ch arg to win_printf_lineJames Booth2016-10-151-9/+9
* Use THEME_DEFAULTJames Booth2016-10-141-27/+27
* Add win_printf_lineJames Booth2016-10-141-6/+6
* Always use string format in win_printfJames Booth2016-10-121-15/+15
* Add win_printf_lineJames Booth2016-10-121-1/+20
> type='string', metavar='dir', default=DEFAULT_CONFDIR, help="the configuration directory. (%default)") parser.add_option('-m', '--mode', type='int', default=0, metavar='n', help="if a filename is supplied, run it with this mode") parser.add_option('-f', '--flags', type='string', default='', metavar='string', help="if a filename is supplied, run it with these flags.") options, positional = parser.parse_args() arg = OpenStruct(options.__dict__, targets=positional) arg.confdir = os.path.expanduser(arg.confdir) if arg.fail_if_run: arg.fail_unless_cd = arg.fail_if_run del arg['fail_if_run'] return arg def allow_access_to_confdir(confdir, allow): if allow: try: os.makedirs(confdir) except OSError as err: if err.errno != 17: # 17 means it already exists print("This configuration directory could not be created:") print(confdir) print("To run ranger without the need for configuration") print("files, use the --clean option.") raise SystemExit() if not confdir in sys.path: sys.path[0:0] = [confdir] else: if sys.path[0] == confdir: del sys.path[0] def load_settings(fm, clean): import ranger.shared import ranger.api.commands import ranger.api.keys if not clean: allow_access_to_confdir(ranger.arg.confdir, True) # Load commands comcont = ranger.api.commands.CommandContainer() ranger.api.commands.alias = comcont.alias try: import commands comcont.load_commands_from_module(commands) except ImportError: pass from ranger.defaults import commands comcont.load_commands_from_module(commands) commands = comcont # Load apps try: import apps except ImportError: from ranger.defaults import apps # Load keys keymanager = ranger.shared.EnvironmentAware.env.keymanager ranger.api.keys.keymanager = keymanager from ranger.defaults import keys try: import keys except ImportError: pass # COMPAT WARNING if hasattr(keys, 'initialize_commands'): print("Warning: the syntax for ~/.config/ranger/keys.py has changed.") print("Your custom keys are not loaded."\ " Please update your configuration.") allow_access_to_confdir(ranger.arg.confdir, False) else: comcont = ranger.api.commands.CommandContainer() ranger.api.commands.alias = comcont.alias from ranger.api import keys keymanager = ranger.shared.EnvironmentAware.env.keymanager ranger.api.keys.keymanager = keymanager from ranger.defaults import commands, keys, apps comcont.load_commands_from_module(commands) commands = comcont fm.commands = commands fm.keys = keys fm.apps = apps.CustomApplications() def load_apps(fm, clean): import ranger if not clean: allow_access_to_confdir(ranger.arg.confdir, True) try: import apps except ImportError: from ranger.defaults import apps allow_access_to_confdir(ranger.arg.confdir, False) else: from ranger.defaults import apps fm.apps = apps.CustomApplications() def main(): """initialize objects and run the filemanager""" try: import curses except ImportError as errormessage: print(errormessage) print('ranger requires the python curses module. Aborting.') sys.exit(1) try: locale.setlocale(locale.LC_ALL, '') except: print("Warning: Unable to set locale. Expect encoding problems.") if not 'SHELL' in os.environ: os.environ['SHELL'] = 'bash' arg = parse_arguments() if arg.clean: sys.dont_write_bytecode = True # Need to decide whether to write bytecode or not before importing. import ranger from ranger.ext import curses_interrupt_handler from ranger.core.runner import Runner from ranger.core.fm import FM from ranger.core.environment import Environment from ranger.gui.defaultui import DefaultUI as UI from ranger.fsobject import File from ranger.shared import (EnvironmentAware, FileManagerAware, SettingsAware) if not arg.debug: curses_interrupt_handler.install_interrupt_handler() ranger.arg = arg SettingsAware._setup() targets = arg.targets or ['.'] target = targets[0] if arg.targets: if target.startswith('file://'): target = target[7:] if not os.access(target, os.F_OK): print("File or directory doesn't exist: %s" % target) sys.exit(1) elif os.path.isfile(target): def print_function(string): print(string) runner = Runner(logfunc=print_function) load_apps(runner, ranger.arg.clean) runner(files=[File(target)], mode=arg.mode, flags=arg.flags) sys.exit(1 if arg.fail_unless_cd else 0) crash_traceback = None try: # Initialize objects EnvironmentAware._assign(Environment(target)) fm = FM() fm.tabs = dict((n+1, os.path.abspath(path)) for n, path \ in enumerate(targets[:9])) load_settings(fm, ranger.arg.clean) FileManagerAware._assign(fm) fm.ui = UI() # Run the file manager fm.initialize() fm.ui.initialize() fm.loop() except Exception: import traceback crash_traceback = traceback.format_exc() except SystemExit as error: return error.args[0] finally: try: fm.ui.destroy() except (AttributeError, NameError): pass if crash_traceback: print(crash_traceback) print("Ranger crashed. " \ "Please report this (including the traceback) at:") print("http://savannah.nongnu.org/bugs/?group=ranger&func=additem") return 1 return 0 if __name__ == '__main__': # The ranger directory can be executed directly, for example by typing # python /usr/lib/python2.6/site-packages/ranger sys.path.insert(0, os.path.dirname(sys.path[0])) main()