コード例 #1
0
ファイル: postproc.py プロジェクト: FiddleCastro/sabnzbd
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)
コード例 #2
0
ファイル: postproc.py プロジェクト: TinyHTPC/xbmc-dev-repo
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)
コード例 #3
0
ファイル: downloader.py プロジェクト: LouisParkin/sabnzbd
 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()
コード例 #4
0
ファイル: downloader.py プロジェクト: FiddleCastro/sabnzbd
 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()
コード例 #5
0
ファイル: downloader.py プロジェクト: 12345z/sabnzbd
 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()
コード例 #6
0
ファイル: downloader.py プロジェクト: claytonbrown/sabnzbd
 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()
コード例 #7
0
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)
コード例 #8
0
ファイル: postproc.py プロジェクト: xphillyx/sabnzbd
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)