def __init__(self, path_to_store, args=None,piece_size=2*1024*1024,no_threads=2,resolver_class=None): BaseClient.__init__(self, path_to_store,args=args) self._pool=None self.resolver_class=resolver_class self._no_threads=self.resolver_class.THREADS if self.resolver_class and hasattr(self.resolver_class,'THREADS') else no_threads self.piece_size=piece_size self._last_downloaded=deque(maxlen=60)
def close(self): self.remove_all_dispatcher_listeners() if self._ses: self._ses.pause() if self._th: self.save_resume() self.save_state() self._stop_services() BaseClient.close(self)
def __init__(self, path_to_store, args=None, piece_size=2 * 1024 * 1024, no_threads=2, resolver_class=None): BaseClient.__init__(self, path_to_store, args=args) self._pool = None self.resolver_class = resolver_class self._no_threads = self.resolver_class.THREADS if self.resolver_class and hasattr( self.resolver_class, 'THREADS') else no_threads self.piece_size = piece_size self._last_downloaded = deque(maxlen=60)
def close(self): self.remove_all_dispatcher_listeners() self._monitor.stop() self._cache.close() if self._ses: self._ses.pause() if self._th: self.save_resume() self.save_state() self._stop_services() try: self._ses.remove_torrent(self._th) except: print 'RuntimeError: invalid torrent handle used' BaseClient.close(self)
def close(self): if self._file: self._file.close() BaseClient.close(self)
def stop(self): BaseClient.stop(self)(self) self._dispatcher.stop() self._dispatcher.join()