From 02fd8621d2252f49920d0365b317db4c90c97c81 Mon Sep 17 00:00:00 2001 From: hut Date: Thu, 14 Oct 2010 17:52:21 +0200 Subject: core.main: import stuff only when needed --- ranger/core/main.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/ranger/core/main.py b/ranger/core/main.py index 36067a5d..c11be241 100644 --- a/ranger/core/main.py +++ b/ranger/core/main.py @@ -24,14 +24,9 @@ def main(): import locale import os.path 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.core.shared import (EnvironmentAware, FileManagerAware, SettingsAware) + from ranger.core.fm import FM try: locale.setlocale(locale.LC_ALL, '') @@ -60,6 +55,8 @@ def main(): elif os.path.isfile(target): def print_function(string): print(string) + from ranger.core.runner import Runner + from ranger.fsobject import File runner = Runner(logfunc=print_function) load_apps(runner, arg.clean) runner(files=[File(target)], mode=arg.mode, flags=arg.flags) @@ -68,6 +65,7 @@ def main(): crash_traceback = None try: # Initialize objects + from ranger.core.environment import Environment fm = FM() FileManagerAware.fm = fm EnvironmentAware.env = Environment(target) @@ -76,8 +74,8 @@ def main(): load_settings(fm, arg.clean) if fm.env.username == 'root': fm.settings.preview_files = False - fm.ui = UI() if not arg.debug: + from ranger.ext import curses_interrupt_handler curses_interrupt_handler.install_interrupt_handler() # Run the file manager -- cgit 1.4.1-2-gfad0 mu/diff/translate_subx?h=main&id=3ccb2c83280e22ad5b7f7c47d7bd95748b969521'>diff stats
path: root/translate_subx
blob: 4df9a9b53337ffe0a642b331e866ff8adafa8751 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56