예제 #1
0
    def get_length(self, selectedfiles=None):
        """ Returns the total size of the content in the torrent. If the
        optional selectedfiles argument is specified, the method returns
        the total size of only those files.
        @return A length (long)
        """
        if not self.metainfo_valid:
            raise NotYetImplementedException()  # must save first

        (length, filepieceranges) = maketorrent.get_length_filepieceranges_from_metainfo(self.metainfo, selectedfiles)
        return length
예제 #2
0
    def get_length(self, selectedfiles=None):
        """ Returns the total size of the content in the torrent. If the
        optional selectedfiles argument is specified, the method returns
        the total size of only those files.
        @return A length (long)
        """
        if not self.metainfo_valid:
            raise NotYetImplementedException()  # must save first

        (length, filepieceranges
         ) = maketorrent.get_length_filepieceranges_from_metainfo(
             self.metainfo, selectedfiles)
        return length
예제 #3
0
    def set_filepieceranges(self):
        """ Determine which file maps to which piece ranges for progress info """
        self._logger.debug("LibtorrentDownloadImpl: set_filepieceranges: %s", self.get_selected_files())

        metainfo = self.tdef.get_metainfo()
        self.filepieceranges = maketorrent.get_length_filepieceranges_from_metainfo(metainfo, [])[1]
예제 #4
0
    def set_filepieceranges(self, metainfo):
        """ Determine which file maps to which piece ranges for progress info """
        if DEBUG:
            print >> sys.stderr,"LibtorrentDownloadImpl: set_filepieceranges:", self.dlconfig['selected_files']

        self.filepieceranges = maketorrent.get_length_filepieceranges_from_metainfo(metainfo, [])[1]
    def set_filepieceranges(self, metainfo):
        """ Determine which file maps to which piece ranges for progress info """
        if DEBUG:
            print >> sys.stderr,"LibtorrentDownloadImpl: set_filepieceranges:", self.dlconfig['selected_files']

        self.filepieceranges = maketorrent.get_length_filepieceranges_from_metainfo(metainfo, [])[1]