14 from __future__ import unicode_literals |
14 from __future__ import unicode_literals |
15 |
15 |
16 import Toolbox.PyQt4ImportHook # __IGNORE_WARNING__ |
16 import Toolbox.PyQt4ImportHook # __IGNORE_WARNING__ |
17 |
17 |
18 try: # Only for Py2 |
18 try: # Only for Py2 |
19 import Utilities.compatibility_fixes # __IGNORE_WARNING__ |
19 import Globals.compatibility_fixes # __IGNORE_WARNING__ |
20 except (ImportError): |
20 except (ImportError): |
21 pass |
21 pass |
22 |
22 |
23 import sys |
23 import sys |
|
24 import os |
24 |
25 |
25 for arg in sys.argv: |
26 for arg in sys.argv[:]: |
26 if arg.startswith("--config="): |
27 if arg.startswith("--config="): |
27 import Globals |
28 import Globals |
28 configDir = arg.replace("--config=", "") |
29 configDir = arg.replace("--config=", "") |
29 Globals.setConfigDir(configDir) |
30 Globals.setConfigDir(configDir) |
30 sys.argv.remove(arg) |
31 sys.argv.remove(arg) |
31 break |
32 elif arg.startswith("--settings="): |
|
33 from PyQt5.QtCore import QSettings |
|
34 settingsDir = os.path.expanduser(arg.replace("--settings=", "")) |
|
35 if not os.path.isdir(settingsDir): |
|
36 os.makedirs(settingsDir) |
|
37 QSettings.setPath(QSettings.IniFormat, QSettings.UserScope, |
|
38 settingsDir) |
|
39 sys.argv.remove(arg) |
32 |
40 |
33 from Globals import AppInfo |
41 from Globals import AppInfo |
34 |
42 |
35 from Toolbox import Startup |
43 from Toolbox import Startup |
36 |
44 |
51 Main entry point into the application. |
59 Main entry point into the application. |
52 """ |
60 """ |
53 options = [ |
61 options = [ |
54 ("--config=configDir", |
62 ("--config=configDir", |
55 "use the given directory as the one containing the config files"), |
63 "use the given directory as the one containing the config files"), |
|
64 ("--settings=settingsDir", |
|
65 "use the given directory to store the settings files"), |
56 ("", "names of plugins to install") |
66 ("", "names of plugins to install") |
57 ] |
67 ] |
58 appinfo = AppInfo.makeAppInfo(sys.argv, |
68 appinfo = AppInfo.makeAppInfo(sys.argv, |
59 "Eric6 Plugin Installer", |
69 "Eric6 Plugin Installer", |
60 "", |
70 "", |