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
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
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]
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]