Ejemplo n.º 1
0
 def downloader_shutdown(self):
     logging.info("Shutting down libCURL thread")
     httpclient.stop_thread()
     httpclient.cleanup_libcurl()
     logging.info("Writing HTTP passwords")
     httpauth.write_to_file()
     logging.info("Shutting down event loop thread")
     eventloop.shutdown()
     logging.info("Saving cached ItemInfo objects")
     logging.info("Commiting DB changes")
     app.db.finish_transaction()
     logging.info("Closing Database...")
     if app.db is not None:
         app.db.close()
     signals.system.shutdown()
Ejemplo n.º 2
0
 def downloader_shutdown(self):
     logging.info("Shutting down libCURL thread")
     httpclient.stop_thread()
     httpclient.cleanup_libcurl()
     logging.info("Writing HTTP passwords")
     httpauth.write_to_file()
     logging.info("Shutting down event loop thread")
     eventloop.shutdown()
     logging.info("Saving cached ItemInfo objects")
     logging.info("Commiting DB changes")
     app.db.finish_transaction()
     logging.info("Closing Database...")
     if app.db is not None:
         app.db.close()
     signals.system.shutdown()
Ejemplo n.º 3
0
 def run_eventloop_until_download(self):
     tracker = self.feed.downloaded_items.make_tracker()
     tracker.connect('added', lambda view, obj: eventloop.shutdown())
     try:
         self.runEventLoop()
     finally:
         tracker.unlink()
Ejemplo n.º 4
0
 def run_eventloop_until_download(self):
     tracker = self.feed.downloaded_items.make_tracker()
     tracker.connect('added', lambda view, obj: eventloop.shutdown())
     try:
         self.runEventLoop()
     finally:
         tracker.unlink()
Ejemplo n.º 5
0
Archivo: daemon.py Proyecto: kmshi/miro
 def handle_close(self, type_):
     if self.shutdown:
         return
     logging.info("downloader: quitting")
     self.shutdown = True
     eventloop.shutdown()
     from miro.dl_daemon import download
     download.shutdown()
     logging.info("Cleaning up libcurl")
     httpclient.stop_thread()
     httpclient.cleanup_libcurl()
     import threading
     for thread in threading.enumerate():
         if thread != threading.currentThread() and not thread.isDaemon():
             logging.info("joining with %s", thread)
             thread.join()
     logging.info("handle_close() done")
Ejemplo n.º 6
0
 def handle_close(self, type_):
     if self.shutdown:
         return
     logging.info("downloader: quitting")
     self.shutdown = True
     eventloop.shutdown()
     logging.info("Cleaning up libcurl")
     httpclient.stop_thread()
     httpclient.cleanup_libcurl()
     from miro.dl_daemon import download
     download.shutdown()
     import threading
     for thread in threading.enumerate():
         if thread != threading.currentThread() and not thread.isDaemon():
             logging.info("joining with %s", thread)
             thread.join()
     logging.info("handle_close() done")
Ejemplo n.º 7
0
 def stopEventLoop(self, abnormal = True):
     self.hadToStopEventLoop = abnormal
     eventloop.shutdown()
Ejemplo n.º 8
0
 def response_sent(self):
     eventloop.shutdown()
     logging.info("Shutdown complete")
Ejemplo n.º 9
0
 def stopEventLoop(self, abnormal=True):
     self.hadToStopEventLoop = abnormal
     eventloop.shutdown()
Ejemplo n.º 10
0
 def callback(self, *args, **kwargs):
     self.got_args.append(args)
     self.got_kwargs.append(kwargs)
     if 'stop' in kwargs.keys():
         eventloop.shutdown()
Ejemplo n.º 11
0
 def callback(self, *args, **kwargs):
     self.got_args.append(args)
     self.got_kwargs.append(kwargs)
     if 'stop' in kwargs.keys():
         eventloop.shutdown()
Ejemplo n.º 12
0
 def response_sent(self):
     eventloop.shutdown()
     logging.info("Shutdown complete")