def run(self): import veusz.setting import veusz.widgets import veusz.utils.vzdbus as vzdbus import veusz.utils.vzsamp as vzsamp vzdbus.setup() vzsamp.setup()
def initImports(): '''Do imports and start up DBUS/SAMP.''' import veusz.setting import veusz.widgets import veusz.utils.vzdbus as vzdbus import veusz.utils.vzsamp as vzsamp vzdbus.setup() vzsamp.setup()
def slotStartApplication(self): """Start app, after modules imported.""" options = self.options args = self.args from veusz.utils import vzdbus, vzsamp vzdbus.setup() vzsamp.setup() from veusz import document from veusz import setting # install exception hook after thread has finished sys.excepthook = excepthook # for people who want to run any old script setting.transient_settings['unsafe_mode'] = bool( options.unsafe_mode) # add directories to path if setting.settingdb['external_pythonpath']: sys.path += setting.settingdb['external_pythonpath'].split(':') # load any requested plugins if options.plugin: document.Document.loadPlugins(pluginlist=options.plugin) # different modes if options.listen: # listen to incoming commands listen(args, quiet=options.quiet) elif options.export: export(options.export, args) self.quit() sys.exit(0) else: # standard start main window self.openMainWindow(args) self.startupdone = True # clear splash when startup done if self.splash is not None: self.splash.finish(self.topLevelWidgets()[0])
def slotStartApplication(self): """Start app, after modules imported.""" options = self.options args = self.args from veusz.utils import vzdbus, vzsamp vzdbus.setup() vzsamp.setup() from veusz import document from veusz import setting # install exception hook after thread has finished sys.excepthook = excepthook # for people who want to run any old script setting.transient_settings['unsafe_mode'] = bool(options.unsafe_mode) # add directories to path if setting.settingdb['external_pythonpath']: sys.path += setting.settingdb['external_pythonpath'].split(':') # load any requested plugins if options.plugin: document.Document.loadPlugins(pluginlist=options.plugin) # different modes if options.listen: # listen to incoming commands listen(args, quiet=options.quiet) elif options.export: export(options.export, args) self.quit() sys.exit(0) else: # standard start main window self.openMainWindow(args) self.startupdone = True # clear splash when startup done if self.splash is not None: self.splash.finish(self.topLevelWidgets()[0])
def slotStartApplication(self): """Start app, after modules imported.""" args = self.args from veusz.utils import vzdbus, vzsamp vzdbus.setup() vzsamp.setup() # add text if we want to display an error after startup startuperrors = [] from veusz import document from veusz import setting # install exception hook after thread has finished global defaultexcepthook defaultexcepthook = sys.excepthook sys.excepthook = excepthook # for people who want to run any old script setting.transient_settings['unsafe_mode'] = bool(args.unsafe_mode) # optionally load a translation txfile = args.translation or setting.settingdb['translation_file'] if txfile: self.trans = qt.QTranslator() if self.trans.load(txfile): self.installTranslator(self.trans) else: startuperrors.append('Error loading translation "%s"' % txfile) # add directories to path if setting.settingdb['external_pythonpath']: sys.path += setting.settingdb['external_pythonpath'].split(':') # load any requested plugins if args.plugin: try: document.Document.loadPlugins(pluginlist=args.plugin) except RuntimeError as e: startuperrors.append(cstr(e)) # different modes if args.listen: # listen to incoming commands listen(args.docs, quiet=args.quiet) elif args.export: export(args.export, args.docs, args.export_option) self.quit() sys.exit(0) else: # standard start main window self.openMainWindow(args.docs) self.startupdone = True # clear splash when startup done if self.splash is not None: self.splash.finish(self.topLevelWidgets()[0]) # this has to be displayed after the main window is created, # otherwise it never gets shown for error in startuperrors: qt.QMessageBox.critical(None, "Veusz", error)