eric6_browser.py

branch
QtWebEngine
changeset 4788
7076adec8ddd
parent 4787
2a19edf4db14
child 4790
deeea3d64858
equal deleted inserted replaced
4787:2a19edf4db14 4788:7076adec8ddd
46 "eric6 Error", 46 "eric6 Error",
47 "You need at least Qt Version {0} to execute the web browser." 47 "You need at least Qt Version {0} to execute the web browser."
48 .format(MIN_QT_VERSION)) 48 .format(MIN_QT_VERSION))
49 sys.exit(100) 49 sys.exit(100)
50 50
51 SettingsDir = None
52
51 for arg in sys.argv[:]: 53 for arg in sys.argv[:]:
52 if arg.startswith("--config="): 54 if arg.startswith("--config="):
53 import Globals 55 import Globals
54 configDir = arg.replace("--config=", "") 56 configDir = arg.replace("--config=", "")
55 Globals.setConfigDir(configDir) 57 Globals.setConfigDir(configDir)
56 sys.argv.remove(arg) 58 sys.argv.remove(arg)
57 elif arg.startswith("--settings="): 59 elif arg.startswith("--settings="):
58 from PyQt5.QtCore import QSettings 60 from PyQt5.QtCore import QSettings
59 settingsDir = os.path.expanduser(arg.replace("--settings=", "")) 61 SettingsDir = os.path.expanduser(arg.replace("--settings=", ""))
60 if not os.path.isdir(settingsDir): 62 if not os.path.isdir(SettingsDir):
61 os.makedirs(settingsDir) 63 os.makedirs(SettingsDir)
62 QSettings.setPath(QSettings.IniFormat, QSettings.UserScope, 64 QSettings.setPath(QSettings.IniFormat, QSettings.UserScope,
63 settingsDir) 65 SettingsDir)
64 sys.argv.remove(arg) 66 sys.argv.remove(arg)
65 67
66 # make ThirdParty package available as a packages repository 68 # make ThirdParty package available as a packages repository
67 sys.path.insert(2, os.path.join(os.path.dirname(__file__), 69 sys.path.insert(2, os.path.join(os.path.dirname(__file__),
68 "ThirdParty", "Pygments")) 70 "ThirdParty", "Pygments"))
100 home = argv[1] 102 home = argv[1]
101 except IndexError: 103 except IndexError:
102 home = "" 104 home = ""
103 105
104 browser = WebBrowserWindow(home, '.', None, 'web_browser', 106 browser = WebBrowserWindow(home, '.', None, 'web_browser',
105 searchWord=searchWord, private=private) 107 searchWord=searchWord, private=private,
108 settingsDir=SettingsDir)
106 return browser 109 return browser
107 110
108 111
109 def main(): 112 def main():
110 """ 113 """

eric ide

mercurial