13 from __future__ import unicode_literals |
13 from __future__ import unicode_literals |
14 |
14 |
15 import Toolbox.PyQt4ImportHook # __IGNORE_WARNING__ |
15 import Toolbox.PyQt4ImportHook # __IGNORE_WARNING__ |
16 |
16 |
17 try: # Only for Py2 |
17 try: # Only for Py2 |
18 import Utilities.compatibility_fixes # __IGNORE_WARNING__ |
18 import Globals.compatibility_fixes # __IGNORE_WARNING__ |
19 except (ImportError): |
19 except (ImportError): |
20 pass |
20 pass |
21 |
21 |
22 import sys |
22 import sys |
23 import os |
23 import os |
24 |
24 |
25 for arg in sys.argv: |
25 for arg in sys.argv[:]: |
26 if arg.startswith("--config="): |
26 if arg.startswith("--config="): |
27 import Globals |
27 import Globals |
28 configDir = arg.replace("--config=", "") |
28 configDir = arg.replace("--config=", "") |
29 Globals.setConfigDir(configDir) |
29 Globals.setConfigDir(configDir) |
30 sys.argv.remove(arg) |
30 sys.argv.remove(arg) |
31 break |
31 elif arg.startswith("--settings="): |
|
32 from PyQt5.QtCore import QSettings |
|
33 settingsDir = os.path.expanduser(arg.replace("--settings=", "")) |
|
34 if not os.path.isdir(settingsDir): |
|
35 os.makedirs(settingsDir) |
|
36 QSettings.setPath(QSettings.IniFormat, QSettings.UserScope, |
|
37 settingsDir) |
|
38 sys.argv.remove(arg) |
32 |
39 |
33 # make ThirdParty package available as a packages repository |
40 # make ThirdParty package available as a packages repository |
34 sys.path.insert(2, os.path.join(os.path.dirname(__file__), |
41 sys.path.insert(2, os.path.join(os.path.dirname(__file__), |
35 "ThirdParty", "Pygments")) |
42 "ThirdParty", "Pygments")) |
36 |
43 |
58 Main entry point into the application. |
65 Main entry point into the application. |
59 """ |
66 """ |
60 options = [ |
67 options = [ |
61 ("--config=configDir", |
68 ("--config=configDir", |
62 "use the given directory as the one containing the config files"), |
69 "use the given directory as the one containing the config files"), |
|
70 ("--settings=settingsDir", |
|
71 "use the given directory to store the settings files"), |
63 ] |
72 ] |
64 appinfo = AppInfo.makeAppInfo(sys.argv, |
73 appinfo = AppInfo.makeAppInfo(sys.argv, |
65 "Eric6 Configure", |
74 "Eric6 Configure", |
66 "", |
75 "", |
67 "Configuration editor for eric6", |
76 "Configuration editor for eric6", |