Logo Search packages:      
Sourcecode: hellanzb version File versions  Download package

def Hellanzb::PostProcessor::PostProcessor::triggerParRecovery (   self,
  nmp 
)

Trigger a par recovery download for the specified NeedMorePars exception 

Definition at line 550 of file PostProcessor.py.

00550                                      :
        """ Trigger a par recovery download for the specified NeedMorePars exception """
        if self.background and self.isNZBArchive() and self.hasMorePars:
            # Must download more pars. Move the archive to the postponed dir, and
            # triggere the special force call for par recoveries
            postponedDir = os.path.join(Hellanzb.POSTPONED_DIR,
                                        os.path.basename(self.dirName))
            move(self.dirName, postponedDir)
            self.archive.archiveDir = self.archive.destDir = postponedDir
            self.archive.nzbFileName = \
                os.path.join(postponedDir, os.path.basename(self.archive.nzbFileName))

            info(archiveName(self.dirName) + \
                 ': More pars available, forcing extra par download')

            self.archive.neededBlocks, self.archive.parType, self.archive.parPrefix = \
                nmp.size, nmp.parType, nmp.parPrefix
            self.forcedRecovery = True

            def triggerRecovery():
                from twisted.internet import reactor
                from Hellanzb.Daemon import forceNZBParRecover # FIXME:
                reactor.callFromThread(forceNZBParRecover, self.archive)
            self.callback = triggerRecovery
            return True
        else:
            info(archiveName(self.dirName) + ': Failed par verify, requires ' + \
                 nmp.neededBlocks + ' more recovery ' + \
                 getParRecoveryName(nmp.parType))
        return False

"""
Copyright (c) 2005 Philip Jenvey <pjenvey@groovie.org>
                   Ben Bangert <bbangert@groovie.org>
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
   notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
   notice, this list of conditions and the following disclaimer in the
   documentation and/or other materials provided with the distribution.
3. The name of the author or contributors may not be used to endorse or
   promote products derived from this software without specific prior
   written permission.

THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.

$Id: PostProcessor.py 848 2006-10-21 20:39:41Z pjenvey $
"""
"""


Generated by  Doxygen 1.6.0   Back to index