def run(user_ns=None): # TODO: Temporary solution, available while Taurus3 is being supported. from taurus import tauruscustomsettings from sardana import sardanacustomsettings max_counts = getattr(sardanacustomsettings, 'TAURUS_MAX_DEPRECATION_COUNTS', 0) tauruscustomsettings._MAX_DEPRECATIONS_LOGGED = max_counts # # initialize input handler as soon as possible import sardana.spock.inputhandler input_handler = sardana.spock.inputhandler.InputHandler() try: mainloop(user_ns=user_ns) finally: try: clean_up() except Exception: pass # TODO: Temporary solution, available while Taurus3 is being supported. try: from taurus.core.util.log import _DEPRECATION_COUNT from taurus import info info('\n*********************\n%s', _DEPRECATION_COUNT.pretty()) except: pass
def run(): # TODO: Temporary solution, available while Taurus3 is being supported. from taurus import tauruscustomsettings from sardana import sardanacustomsettings max_counts = getattr(sardanacustomsettings, 'TAURUS_MAX_DEPRECATION_COUNTS', 0) tauruscustomsettings._MAX_DEPRECATIONS_LOGGED = max_counts try: check_requirements() except exception.SpockMissingRequirement as requirement: print(str(requirement)) sys.exit(-1) except exception.SpockMissingRecommended as recommended: print(str(recommended)) prepare_input_handler() prepare_cmdline() launch_new_instance() # TODO: Temporary solution, available while Taurus3 is being supported. try: from taurus.core.util.log import _DEPRECATION_COUNT from taurus import info info('\n*********************\n%s', _DEPRECATION_COUNT.pretty()) except: pass
def exec_(*args, **kwargs): # TODO: substitute this ugly hack by some more general mechanism try: ret = Qt.QApplication.exec_(*args, **kwargs) except TypeError: ret = Qt.QApplication.exec_(*args) from taurus.core.util.log import _DEPRECATION_COUNT from taurus import info info('\n*********************\n%s', _DEPRECATION_COUNT.pretty()) return ret
def _banner_default(self): config = get_config() return config.FrontendWidget.banner IPythonQtConsoleApp.widget_factory = SpockConsole except ImportError: pass try: check_requirements() except exception.SpockMissingRequirement, requirement: print str(requirement) sys.exit(-1) except exception.SpockMissingRecommended, recommended: print str(recommended) prepare_input_handler() prepare_cmdline() launch_new_instance() # TODO: Temporary solution, available while Taurus3 is being supported. try: from taurus.core.util.log import _DEPRECATION_COUNT from taurus import info info('\n*********************\n%s', _DEPRECATION_COUNT.pretty()) except: pass