except: pass # Auto-start GUI if qt.config.get('startgui', True): qt.flow.start_gui() temp.File.set_temp_dir(qt.config['tempdir']) # change startdir if commandline option is given if __startdir__ is not None: qt.config['startdir'] = __startdir__ # FIXME: use of __startdir__ is spread over multiple scripts: # 1) source/qtlab_client_shell.py # 2) init/02_qtlab_start.py # This should be solved differently # Set exception handler try: import qtflow # Note: This does not seem to work for 'KeyboardInterrupt', # likely it is already caught by ipython itself. get_ipython().set_custom_exc((Exception, ), qtflow.exception_handler) except Exception, e: print 'Error: %s' % str(e) # Other functions should be registered using qt.flow.register_exit_handler from lib.misc import register_exit import qtflow register_exit(qtflow.qtlab_exit)