eric6_webbrowser.py

changeset 4343
afe0da217745
parent 4289
6c1ab651c9ce
child 4631
5c1a96925da4
equal deleted inserted replaced
4341:1ff0929aab09 4343:afe0da217745
15 from __future__ import unicode_literals 15 from __future__ import unicode_literals
16 16
17 import Toolbox.PyQt4ImportHook # __IGNORE_WARNING__ 17 import Toolbox.PyQt4ImportHook # __IGNORE_WARNING__
18 18
19 try: # Only for Py2 19 try: # Only for Py2
20 import Utilities.compatibility_fixes # __IGNORE_WARNING__ 20 import Globals.compatibility_fixes # __IGNORE_WARNING__
21 except (ImportError): 21 except (ImportError):
22 pass 22 pass
23 23
24 try: 24 try:
25 import sip 25 import sip
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",

eric ide

mercurial