diff options
author | hut <hut@lavabit.com> | 2010-04-23 13:33:57 +0200 |
---|---|---|
committer | hut <hut@lavabit.com> | 2010-04-23 13:34:12 +0200 |
commit | 9b8942083ac4cd17cd4e75afa3a217ce7171cc14 (patch) | |
tree | 5ee8bf01990a001518d594451ae775e00c009a71 /ranger | |
parent | c135aa1c193877d06e6a01f1445577811786f479 (diff) | |
download | ranger-9b8942083ac4cd17cd4e75afa3a217ce7171cc14.tar.gz |
main: fixed "ranger /path/to/a/file"
Diffstat (limited to 'ranger')
-rw-r--r-- | ranger/__main__.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/ranger/__main__.py b/ranger/__main__.py index f22c2336..0814565f 100644 --- a/ranger/__main__.py +++ b/ranger/__main__.py @@ -29,6 +29,7 @@ from signal import signal, SIGINT from locale import getdefaultlocale, setlocale, LC_ALL 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.shared import (EnvironmentAware, FileManagerAware, @@ -172,10 +173,11 @@ def main(): print("File or directory doesn't exist: %s" % target) sys.exit(1) elif os.path.isfile(target): - thefile = File(target) - fm = FM() - load_settings(fm, ranger.arg.clean) - fm.execute_file(thefile, mode=arg.mode, flags=arg.flags) + 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(0) else: path = target |