def start(winhndl=None): """ Start quickscan. """ log.info("QuickScan starting..") # Check permissions verify_config_access() if not development_mode(default=True): # Generating temporary files names stdout_output = tempfile.mktemp() stderr_output = tempfile.mktemp() _stdout = open(stdout_output, "w") _stderr = open(stderr_output, "w") sys.stdout = _stdout sys.stderr = _stderr sys.excepthook = UmitExceptionHook() try: run_quickscan(winhndl) except KeyboardInterrupt: # if we are on win32, we should be here in case a WM_CLOSE message # was sent. safe_shutdown(None, None) else: # run_scheduler should finish normally when running as a Windows # Service safe_shutdown(None, None)
def run(self): # Try to load psyco module, saving this information # if we care to use it later (such as in a About Dialog) if not development_mode(default=False): try: import psyco except ImportError: log.warning(_("RUNNING WITHOUT PSYCO!")) log.warning(_("psyco is a module that speeds up the execution " "of Python applications. It is not a requirement, and " "Umit will work normally without it, but you're " "encouraged to install it to have a better speed " "experience. Download psyco at http://psyco.sf.net/""")) self.using_psyco = False else: psyco.profile() self.using_psyco = True self.diff = option_parser.get_diff() if self.diff: self.__run_text() else: self.__run_gui()