##// END OF EJS Templates
cleanup pass on qtconsoleap per review...
MinRK -
Show More
@@ -356,6 +356,17 b' class IPythonQtConsoleApp(BaseIPythonApplication):'
356 swallow_next = True
356 swallow_next = True
357
357
358 def init_connection_file(self):
358 def init_connection_file(self):
359 """find the connection file, and load the info if found.
360
361 The current working directory and the current profile's security
362 directory will be searched for the file if it is not given by
363 absolute path.
364
365 When attempting to connect to an existing kernel and the `--existing`
366 argument does not match an existing file, it will be interpreted as a
367 fileglob, and the matching file in the current profile's security dir
368 with the latest access time will be used.
369 """
359 sec = self.profile_dir.security_dir
370 sec = self.profile_dir.security_dir
360 if self.existing:
371 if self.existing:
361 try:
372 try:
@@ -368,7 +379,7 b' class IPythonQtConsoleApp(BaseIPythonApplication):'
368 pat = self.existing
379 pat = self.existing
369 else:
380 else:
370 # accept any substring match
381 # accept any substring match
371 pat = '*%s*'
382 pat = '*%s*' % self.existing
372 matches = glob.glob( os.path.join(sec, pat) )
383 matches = glob.glob( os.path.join(sec, pat) )
373 if not matches:
384 if not matches:
374 self.log.critical("Could not find existing kernel connection file %s", self.existing)
385 self.log.critical("Could not find existing kernel connection file %s", self.existing)
@@ -446,7 +457,7 b' class IPythonQtConsoleApp(BaseIPythonApplication):'
446 try:
457 try:
447 cf = filefind(self.connection_file, ['.', sec])
458 cf = filefind(self.connection_file, ['.', sec])
448 except IOError:
459 except IOError:
449 # file might not exist, use
460 # file might not exist
450 if self.connection_file == os.path.basename(self.connection_file):
461 if self.connection_file == os.path.basename(self.connection_file):
451 # just shortname, put it in security dir
462 # just shortname, put it in security dir
452 cf = os.path.join(sec, self.connection_file)
463 cf = os.path.join(sec, self.connection_file)
General Comments 0
You need to be logged in to leave comments. Login now