eric6/eric6.py

changeset 7257
c4d0cac9b5c9
parent 7240
5d7a17a948ad
child 7315
41fdf2cd1c33
equal deleted inserted replaced
7256:4ef3b78ebb4e 7257:c4d0cac9b5c9
110 from E5Gui.E5SingleApplication import E5SingleApplicationClient 110 from E5Gui.E5SingleApplication import E5SingleApplicationClient
111 111
112 client = E5SingleApplicationClient() 112 client = E5SingleApplicationClient()
113 res = client.connect() 113 res = client.connect()
114 if res > 0: 114 if res > 0:
115 if "--no-splash" in sys.argv and \ 115 if (
116 sys.argv.index("--no-splash") < ddindex: 116 "--no-splash" in sys.argv and
117 sys.argv.index("--no-splash") < ddindex
118 ):
117 sys.argv.remove("--no-splash") 119 sys.argv.remove("--no-splash")
118 ddindex -= 1 120 ddindex -= 1
119 if "--no-open" in sys.argv and sys.argv.index("--no-open") < ddindex: 121 if "--no-open" in sys.argv and sys.argv.index("--no-open") < ddindex:
120 sys.argv.remove("--no-open") 122 sys.argv.remove("--no-open")
121 ddindex -= 1 123 ddindex -= 1
122 if "--no-crash" in sys.argv and sys.argv.index("--no-crash") < ddindex: 124 if "--no-crash" in sys.argv and sys.argv.index("--no-crash") < ddindex:
123 sys.argv.remove("--no-crash") 125 sys.argv.remove("--no-crash")
124 if "--disable-crash" in sys.argv and \ 126 if (
125 sys.argv.index("--disable-crash") < ddindex: 127 "--disable-crash" in sys.argv and
128 sys.argv.index("--disable-crash") < ddindex
129 ):
126 sys.argv.remove("--disable-crash") 130 sys.argv.remove("--disable-crash")
127 ddindex -= 1 131 ddindex -= 1
128 if "--debug" in sys.argv and sys.argv.index("--debug") < ddindex: 132 if "--debug" in sys.argv and sys.argv.index("--debug") < ddindex:
129 sys.argv.remove("--debug") 133 sys.argv.remove("--debug")
130 ddindex -= 1 134 ddindex -= 1
131 for arg in sys.argv: 135 for arg in sys.argv:
132 if arg.startswith("--config=") and \ 136 if (
133 sys.argv.index(arg) < ddindex: 137 arg.startswith("--config=") and
138 sys.argv.index(arg) < ddindex
139 ):
134 sys.argv.remove(arg) 140 sys.argv.remove(arg)
135 ddindex -= 1 141 ddindex -= 1
136 break 142 break
137 for arg in sys.argv: 143 for arg in sys.argv:
138 if arg.startswith("--plugin=") and \ 144 if (
139 sys.argv.index(arg) < ddindex: 145 arg.startswith("--plugin=") and
146 sys.argv.index(arg) < ddindex
147 ):
140 sys.argv.remove(arg) 148 sys.argv.remove(arg)
141 ddindex -= 1 149 ddindex -= 1
142 break 150 break
143 for arg in sys.argv[:]: 151 for arg in sys.argv[:]:
144 if arg.startswith("--disable-plugin=") and \ 152 if (
145 sys.argv.index(arg) < ddindex: 153 arg.startswith("--disable-plugin=") and
154 sys.argv.index(arg) < ddindex
155 ):
146 sys.argv.remove(arg) 156 sys.argv.remove(arg)
147 ddindex -= 1 157 ddindex -= 1
148 158
149 if len(sys.argv) > 1: 159 if len(sys.argv) > 1:
150 client.processArgs(sys.argv[1:]) 160 client.processArgs(sys.argv[1:])
167 import Utilities 177 import Utilities
168 import Globals 178 import Globals
169 179
170 separator = '-' * 80 180 separator = '-' * 80
171 logFile = os.path.join(Globals.getConfigDir(), "eric6_error.log") 181 logFile = os.path.join(Globals.getConfigDir(), "eric6_error.log")
172 notice = \ 182 notice = (
173 """An unhandled exception occurred. Please report the problem\n"""\ 183 """An unhandled exception occurred. Please report the problem\n"""
174 """using the error reporting dialog or via email to <{0}>.\n"""\ 184 """using the error reporting dialog or via email to <{0}>.\n"""
175 """A log has been written to "{1}".\n\nError information:\n""".format( 185 """A log has been written to "{1}".\n\nError information:\n""".format(
176 BugAddress, logFile) 186 BugAddress, logFile)
187 )
177 timeString = time.strftime("%Y-%m-%d, %H:%M:%S") 188 timeString = time.strftime("%Y-%m-%d, %H:%M:%S")
178 189
179 versionInfo = "\n{0}\n{1}".format( 190 versionInfo = "\n{0}\n{1}".format(
180 separator, Utilities.generateVersionInfo()) 191 separator, Utilities.generateVersionInfo())
181 pluginVersionInfo = Utilities.generatePluginsVersionInfo() 192 pluginVersionInfo = Utilities.generatePluginsVersionInfo()
207 warning = notice + msg + versionInfo 218 warning = notice + msg + versionInfo
208 print(warning) # __IGNORE_WARNING_M801__ 219 print(warning) # __IGNORE_WARNING_M801__
209 else: 220 else:
210 warning = notice + msg + versionInfo 221 warning = notice + msg + versionInfo
211 # Escape &<> otherwise it's not visible in the error dialog 222 # Escape &<> otherwise it's not visible in the error dialog
212 warning = warning\ 223 warning = (
213 .replace("&", "&amp;")\ 224 warning
214 .replace(">", "&gt;")\ 225 .replace("&", "&amp;")
226 .replace(">", "&gt;")
215 .replace("<", "&lt;") 227 .replace("<", "&lt;")
228 )
216 qWarning(warning) 229 qWarning(warning)
217 230
218 231
219 def uiStartUp(): 232 def uiStartUp():
220 """ 233 """
329 noopen = True 342 noopen = True
330 if "--no-crash" in sys.argv and sys.argv.index("--no-crash") < ddindex: 343 if "--no-crash" in sys.argv and sys.argv.index("--no-crash") < ddindex:
331 sys.argv.remove("--no-crash") 344 sys.argv.remove("--no-crash")
332 ddindex -= 1 345 ddindex -= 1
333 nocrash = True 346 nocrash = True
334 if "--disable-crash" in sys.argv and \ 347 if (
335 sys.argv.index("--disable-crash") < ddindex: 348 "--disable-crash" in sys.argv and
349 sys.argv.index("--disable-crash") < ddindex
350 ):
336 sys.argv.remove("--disable-crash") 351 sys.argv.remove("--disable-crash")
337 ddindex -= 1 352 ddindex -= 1
338 disablecrash = True 353 disablecrash = True
339 for arg in sys.argv[:]: 354 for arg in sys.argv[:]:
340 if arg.startswith("--disable-plugin=") and \ 355 if (
341 sys.argv.index(arg) < ddindex: 356 arg.startswith("--disable-plugin=") and
357 sys.argv.index(arg) < ddindex
358 ):
342 # extract the plug-in name 359 # extract the plug-in name
343 pluginName = arg.replace("--disable-plugin=", "") 360 pluginName = arg.replace("--disable-plugin=", "")
344 sys.argv.remove(arg) 361 sys.argv.remove(arg)
345 ddindex -= 1 362 ddindex -= 1
346 disabledPlugins.append(pluginName) 363 disabledPlugins.append(pluginName)

eric ide

mercurial