Example #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()
Example #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()
Example #3
0
 def test_store(self):
     self.setup_answer("user", "password")
     self.grab_url(self.httpserver.build_url('protected/index.txt'))
     self.assertEquals(self.dialogs_seen, 1)
     # write out the data
     store_path = self.make_temp_path('.json')
     httpauth.write_to_file(store_path)
     # reset the data, check that we get a new dialog
     httpauth.init()
     self.grab_url(self.httpserver.build_url('protected/index.txt'))
     self.assertEquals(self.dialogs_seen, 2)
     # reset the data, then restore from file.  We shouldn't get a new
     # dialog this time
     httpauth.init()
     httpauth.restore_from_file(store_path)
     self.grab_url(self.httpserver.build_url('protected/index.txt'))
     self.assertEquals(self.dialogs_seen, 2)