##// END OF EJS Templates
AttributeError check on config no longer works...
MinRK -
Show More
@@ -272,10 +272,7 b' class BaseIPythonApplication(Application):'
272 272 if self.profile_dir is not None:
273 273 # already ran
274 274 return
275 try:
276 # location explicitly specified:
277 location = self.config.ProfileDir.location
278 except AttributeError:
275 if 'ProfileDir.location' not in self.config:
279 276 # location not specified, find by profile name
280 277 try:
281 278 p = ProfileDir.find_profile_dir_by_name(self.ipython_dir, self.profile, self.config)
@@ -295,6 +292,7 b' class BaseIPythonApplication(Application):'
295 292 else:
296 293 self.log.info("Using existing profile dir: %r"%p.location)
297 294 else:
295 location = self.config.ProfileDir.location
298 296 # location is fully specified
299 297 try:
300 298 p = ProfileDir.find_profile_dir(location, self.config)
@@ -399,9 +399,9 b' class IPControllerApp(BaseParallelApplication):'
399 399 q.connect_mon(monitor_url)
400 400 q.daemon=True
401 401 children.append(q)
402 try:
402 if 'TaskScheduler.scheme_name' in self.config:
403 403 scheme = self.config.TaskScheduler.scheme_name
404 except AttributeError:
404 else:
405 405 scheme = TaskScheduler.scheme_name.get_default_value()
406 406 # Task Queue (in a Process)
407 407 if scheme == 'pure':
@@ -211,14 +211,9 b' class IPEngineApp(BaseParallelApplication):'
211 211
212 212 # allow hand-override of location for disambiguation
213 213 # and ssh-server
214 try:
215 config.EngineFactory.location
216 except AttributeError:
214 if 'EngineFactory.location' not in config:
217 215 config.EngineFactory.location = d['location']
218
219 try:
220 config.EngineFactory.sshserver
221 except AttributeError:
216 if 'EngineFactory.sshserver' not in config:
222 217 config.EngineFactory.sshserver = d.get('ssh')
223 218
224 219 location = config.EngineFactory.location
@@ -313,21 +308,17 b' class IPEngineApp(BaseParallelApplication):'
313 308 self.log.fatal("Fatal: url file never arrived: %s", self.url_file)
314 309 self.exit(1)
315 310
311 exec_lines = []
312 for app in ('IPKernelApp', 'InteractiveShellApp'):
313 if '%s.exec_lines' in config:
314 exec_lines = config.IPKernelApp.exec_lines = config[app].exec_lines
315 break
316 316
317 try:
318 exec_lines = config.IPKernelApp.exec_lines
319 except AttributeError:
320 try:
321 exec_lines = config.InteractiveShellApp.exec_lines
322 except AttributeError:
323 exec_lines = config.IPKernelApp.exec_lines = []
324 try:
325 exec_files = config.IPKernelApp.exec_files
326 except AttributeError:
327 try:
328 exec_files = config.InteractiveShellApp.exec_files
329 except AttributeError:
330 exec_files = config.IPKernelApp.exec_files = []
317 exec_files = []
318 for app in ('IPKernelApp', 'InteractiveShellApp'):
319 if '%s.exec_files' in config:
320 exec_files = config.IPKernelApp.exec_files = config[app].exec_files
321 break
331 322
332 323 if self.startup_script:
333 324 exec_files.append(self.startup_script)
@@ -255,10 +255,9 b' class HubFactory(RegistrationFactory):'
255 255
256 256 ctx = self.context
257 257 loop = self.loop
258
259 try:
258 if 'TaskScheduler.scheme_name' in self.config:
260 259 scheme = self.config.TaskScheduler.scheme_name
261 except AttributeError:
260 else:
262 261 from .scheduler import TaskScheduler
263 262 scheme = TaskScheduler.scheme_name.get_default_value()
264 263
@@ -281,18 +281,10 b' class IPythonQtConsoleApp(BaseIPythonApplication, IPythonConsoleApp):'
281 281 # are removed from the backend.
282 282
283 283 # parse the colors arg down to current known labels
284 try:
285 colors = self.config.ZMQInteractiveShell.colors
286 except AttributeError:
287 colors = None
288 try:
289 style = self.config.IPythonWidget.syntax_style
290 except AttributeError:
291 style = None
292 try:
293 sheet = self.config.IPythonWidget.style_sheet
294 except AttributeError:
295 sheet = None
284 cfg = self.config
285 colors = cfg.ZMQInteractiveShell.colors if 'ZMQInteractiveShell.colors' in cfg else None
286 style = cfg.IPythonWidget.syntax_style if 'IPythonWidget.syntax_style' in cfg else None
287 sheet = cfg.IPythonWidget.style_sheet if 'IPythonWidget.style_sheet' in cfg else None
296 288
297 289 # find the value for colors:
298 290 if colors:
General Comments 0
You need to be logged in to leave comments. Login now