コード例 #1
0
    def _setup_environment(self):
        """Finish misc startup tasks like starting logging, zipping any crash logs 
    from the last run, installing signal handlers, startup argument handler, etc"""

        #apply the necessary hacks:
        Twisted.apply_dns_hack()
        Twisted.apply_dns_hack2()
        if System.IS_WINDOWS:
            Win32HiddenWindowHack.apply()

        #start listening for connections from any other instances of BitBlinder
        StartupServer.start()

        Profiler.start()

        #Make sure we log ALL exceptions
        Twisted.install_exception_handlers(self.on_quit_signal)

        #Set the signal handler for exiting
        def sig_handler(signum, frame):
            self.on_quit_signal()

        signal.signal(signal.SIGTERM, sig_handler)

        #make the gui:
        GUIController.start()
        self.gui = GUIController.get()

        #do some tests to see how this user's network is configured:
        NetworkState.test_network_state()

        #TODO: figure out what needs to change in the wrapper and submit a fix
        warnings.filterwarnings('ignore',
                                module=".*TwistedProtocolWrapper.*",
                                lineno=447)
コード例 #2
0
ファイル: MainLoop.py プロジェクト: clawplach/BitBlinder
 def _setup_environment(self):
   """Finish misc startup tasks like starting logging, zipping any crash logs 
   from the last run, installing signal handlers, startup argument handler, etc"""
   
   #apply the necessary hacks:
   Twisted.apply_dns_hack()
   Twisted.apply_dns_hack2()
   if System.IS_WINDOWS:
     Win32HiddenWindowHack.apply()
   
   #start listening for connections from any other instances of BitBlinder
   StartupServer.start()
   
   Profiler.start()
   
   #Make sure we log ALL exceptions
   Twisted.install_exception_handlers(self.on_quit_signal)
   
   #Set the signal handler for exiting
   def sig_handler(signum, frame):
     self.on_quit_signal()
   signal.signal(signal.SIGTERM, sig_handler)
   
   #make the gui:
   GUIController.start()
   self.gui = GUIController.get()
   
   #do some tests to see how this user's network is configured:
   NetworkState.test_network_state()
   
   #TODO: figure out what needs to change in the wrapper and submit a fix
   warnings.filterwarnings('ignore', module=".*TwistedProtocolWrapper.*", lineno=447)