28 pass |
28 pass |
29 |
29 |
30 import sys |
30 import sys |
31 import os |
31 import os |
32 |
32 |
33 for arg in sys.argv: |
33 for arg in sys.argv[:]: |
34 if arg.startswith("--config="): |
34 if arg.startswith("--config="): |
35 import Globals |
35 import Globals |
36 configDir = arg.replace("--config=", "") |
36 configDir = arg.replace("--config=", "") |
37 Globals.setConfigDir(configDir) |
37 Globals.setConfigDir(configDir) |
38 sys.argv.remove(arg) |
38 sys.argv.remove(arg) |
39 break |
39 elif arg.startswith("--settings="): |
|
40 from PyQt5.QtCore import QSettings |
|
41 settingsDir = os.path.expanduser(arg.replace("--settings=", "")) |
|
42 if not os.path.isdir(settingsDir): |
|
43 os.makedirs(settingsDir) |
|
44 QSettings.setPath(QSettings.IniFormat, QSettings.UserScope, |
|
45 settingsDir) |
|
46 sys.argv.remove(arg) |
40 |
47 |
41 # make ThirdParty package available as a packages repository |
48 # make ThirdParty package available as a packages repository |
42 sys.path.insert(2, os.path.join(os.path.dirname(__file__), |
49 sys.path.insert(2, os.path.join(os.path.dirname(__file__), |
43 "ThirdParty", "Pygments")) |
50 "ThirdParty", "Pygments")) |
44 |
51 |
79 Main entry point into the application. |
86 Main entry point into the application. |
80 """ |
87 """ |
81 options = [ |
88 options = [ |
82 ("--config=configDir", |
89 ("--config=configDir", |
83 "use the given directory as the one containing the config files"), |
90 "use the given directory as the one containing the config files"), |
84 ("--search=word", "search for the given word") |
91 ("--search=word", "search for the given word"), |
|
92 ("--settings=settingsDir", |
|
93 "use the given directory to store the settings files"), |
85 ] |
94 ] |
86 appinfo = AppInfo.makeAppInfo(sys.argv, |
95 appinfo = AppInfo.makeAppInfo(sys.argv, |
87 "eric6 Web Browser", |
96 "eric6 Web Browser", |
88 "file", |
97 "file", |
89 "web browser", |
98 "web browser", |