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

def Hellanzb::NZBLeecher::NZBModel::NZB::isAllPars (   self  ) 

Determine whether or not all nzbFiles in this archive are par files. An NZB only
containing par files needs to be specially handled (all its nzbFiles should be
downloaded, instead of skipped) -- otherwise, no downloading would occur. This
situation isn't applicable to isParRecovery downloads

All nzbFiles in this NZB should have their real filename for the results of this
function to be accurate

newzbin.com will always add the .nfo file to an NZB if it exists (even if you
didn't select it for download) -- this function attempts to take that into account

Definition at line 128 of file NZBModel.py.

00128                        :
        """ Determine whether or not all nzbFiles in this archive are par files. An NZB only
        containing par files needs to be specially handled (all its nzbFiles should be
        downloaded, instead of skipped) -- otherwise, no downloading would occur. This
        situation isn't applicable to isParRecovery downloads

        All nzbFiles in this NZB should have their real filename for the results of this
        function to be accurate

        newzbin.com will always add the .nfo file to an NZB if it exists (even if you
        didn't select it for download) -- this function attempts to take that into account
        """
        if self.isParRecovery:
            return False

        skippedLen = len(self.skippedParFiles)
        nzbFilesLen = len(self.nzbFiles)
        
        if skippedLen == nzbFilesLen:
            return True

        if (skippedLen > 0 and skippedLen == nzbFilesLen - 1) or \
                (skippedLen > 1 and skippedLen == nzbFilesLen - 2):
            # We only queued 1 or 2 files for download. If both are either a main par file
            # or a .nfo file, this is an all par archive
            queuedFiles = [nzbFile for nzbFile in self.nzbFiles if nzbFile not \
                           in self.skippedParFiles]
            for queuedFile in queuedFiles[:]:
                if queuedFile.filename.lower().endswith('.nfo') or queuedFile.isPar:
                    queuedFiles.remove(queuedFile)
                    
            return not len(queuedFiles)

        return False

    def cleanStats(self):


Generated by  Doxygen 1.6.0   Back to index