13 """ |
13 """ |
14 |
14 |
15 import sys |
15 import sys |
16 import os |
16 import os |
17 |
17 |
18 sys.path.insert(1, os.path.dirname(__file__)) |
|
19 |
|
20 for arg in sys.argv[:]: |
18 for arg in sys.argv[:]: |
21 if arg.startswith("--config="): |
19 if arg.startswith("--config="): |
22 import Globals |
20 from eric7 import Globals |
23 |
21 |
24 configDir = arg.replace("--config=", "") |
22 configDir = arg.replace("--config=", "") |
25 Globals.setConfigDir(configDir) |
23 Globals.setConfigDir(configDir) |
26 sys.argv.remove(arg) |
24 sys.argv.remove(arg) |
27 elif arg.startswith("--settings="): |
25 elif arg.startswith("--settings="): |
33 QSettings.setPath( |
31 QSettings.setPath( |
34 QSettings.Format.IniFormat, QSettings.Scope.UserScope, settingsDir |
32 QSettings.Format.IniFormat, QSettings.Scope.UserScope, settingsDir |
35 ) |
33 ) |
36 sys.argv.remove(arg) |
34 sys.argv.remove(arg) |
37 |
35 |
38 from Globals import AppInfo |
36 from eric7.Globals import AppInfo |
39 |
37 |
40 from Toolbox import Startup |
38 from eric7.Toolbox import Startup |
41 |
39 |
42 |
40 |
43 def createMainWidget(argv): |
41 def createMainWidget(argv): |
44 """ |
42 """ |
45 Function to create the main widget. |
43 Function to create the main widget. |
46 |
44 |
47 @param argv list of commandline parameters (list of strings) |
45 @param argv list of commandline parameters (list of strings) |
48 @return reference to the main widget (QWidget) |
46 @return reference to the main widget (QWidget) |
49 """ |
47 """ |
50 from QScintilla.MiniEditor import MiniEditor |
48 from eric7.QScintilla.MiniEditor import MiniEditor |
51 |
49 |
52 if len(argv) > 1: |
50 if len(argv) > 1: |
53 return MiniEditor(argv[1]) |
51 return MiniEditor(argv[1]) |
54 else: |
52 else: |
55 return MiniEditor() |
53 return MiniEditor() |