def handle_empty_queue(): """ Check if empty queue calls for action """ if sabnzbd.nzbqueue.NzbQueue.do.actives() == 0: sabnzbd.save_state() logging.info("Queue has finished, launching: %s (%s)", sabnzbd.QUEUECOMPLETEACTION, sabnzbd.QUEUECOMPLETEARG) if sabnzbd.QUEUECOMPLETEARG: sabnzbd.QUEUECOMPLETEACTION(sabnzbd.QUEUECOMPLETEARG) else: Thread(target=sabnzbd.QUEUECOMPLETEACTION).start() sabnzbd.change_queue_complete_action(cfg.queue_complete(), new=False)
def handle_empty_queue(): """ Check if empty queue calls for action """ if sabnzbd.nzbqueue.NzbQueue.do.actives() == 0: sabnzbd.save_state() logging.info("Queue has finished, launching: %s (%s)", \ sabnzbd.QUEUECOMPLETEACTION, sabnzbd.QUEUECOMPLETEARG) if sabnzbd.QUEUECOMPLETEARG: sabnzbd.QUEUECOMPLETEACTION(sabnzbd.QUEUECOMPLETEARG) else: Thread(target=sabnzbd.QUEUECOMPLETEACTION).start() sabnzbd.change_queue_complete_action(cfg.queue_complete(), new=False)
def pause(self, save=True): """ Pause the downloader, optionally saving admin """ if not self.paused: self.paused = True logging.info("Pausing") growler.send_notification("SABnzbd", T('Paused'), 'download') if self.is_paused(): BPSMeter.do.reset() if cfg.autodisconnect(): self.disconnect() if save: sabnzbd.save_state()
def pause(self, save=True): """ Pause the downloader, optionally saving admin """ if not self.paused: self.paused = True logging.info("Pausing") osx.sendGrowlMsg("SABnzbd",T('Paused'),osx.NOTIFICATION['download']) if self.is_paused(): BPSMeter.do.reset() if cfg.autodisconnect(): self.disconnect() if save: sabnzbd.save_state()
def pause(self, save=True): """ Pause the downloader, optionally saving admin """ if not self.paused: self.paused = True logging.info("Pausing") osx.sendGrowlMsg("SABnzbd", T('Paused'), osx.NOTIFICATION['download']) if self.is_paused(): BPSMeter.do.reset() if cfg.autodisconnect(): self.disconnect() if save: sabnzbd.save_state()
def handle_empty_queue(): """ Check if empty queue calls for action """ if sabnzbd.nzbqueue.NzbQueue.do.actives() == 0: sabnzbd.save_state() notifier.send_notification("SABnzbd", T("Queue finished"), "queue_done") # Perform end-of-queue action when one is set if sabnzbd.QUEUECOMPLETEACTION: logging.info("Queue has finished, launching: %s (%s)", sabnzbd.QUEUECOMPLETEACTION, sabnzbd.QUEUECOMPLETEARG) if sabnzbd.QUEUECOMPLETEARG: sabnzbd.QUEUECOMPLETEACTION(sabnzbd.QUEUECOMPLETEARG) else: Thread(target=sabnzbd.QUEUECOMPLETEACTION).start() sabnzbd.change_queue_complete_action(cfg.queue_complete(), new=False)
def handle_empty_queue(): """ Check if empty queue calls for action """ if sabnzbd.NzbQueue.actives() == 0: sabnzbd.save_state() notifier.send_notification("SABnzbd", T("Queue finished"), "queue_done") # Perform end-of-queue action when one is set if sabnzbd.QUEUECOMPLETEACTION: logging.info("Queue has finished, launching: %s (%s)", sabnzbd.QUEUECOMPLETEACTION, sabnzbd.QUEUECOMPLETEARG) if sabnzbd.QUEUECOMPLETEARG: sabnzbd.QUEUECOMPLETEACTION(sabnzbd.QUEUECOMPLETEARG) else: Thread(target=sabnzbd.QUEUECOMPLETEACTION).start() sabnzbd.change_queue_complete_action(cfg.queue_complete(), new=False) # Trigger garbage collection and release of memory logging.debug("Triggering garbage collection and release of memory") gc.collect() if sabnzbd.LIBC: sabnzbd.LIBC.malloc_trim(0)