def work(self): """ main routine that does the periodical work """ self.tryReconnect() if free_space(self.core.config["general"]["download_folder"]) / 1024 / 1024 < \ self.core.config["general"]["min_free_space"]: self.log.warning(_("Not enough space left on device")) self.paused = True if self.paused or not self.core.api.isTimeDownload(): return False # at least one thread want reconnect and we are supposed to wait if self.core.config['reconnect']['wait'] and self.wantReconnect() > 1: return False self.assignJobs()
def freeSpace(self): """Available free space at download directory in bytes""" return free_space(self.core.config["general"]["download_folder"])