當前位置: 首頁>>代碼示例>>Python>>正文


Python AniDBMaper.getFileBitsA方法代碼示例

本文整理匯總了Python中aniDBmaper.AniDBMaper.getFileBitsA方法的典型用法代碼示例。如果您正苦於以下問題:Python AniDBMaper.getFileBitsA方法的具體用法?Python AniDBMaper.getFileBitsA怎麽用?Python AniDBMaper.getFileBitsA使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在aniDBmaper.AniDBMaper的用法示例。


在下文中一共展示了AniDBMaper.getFileBitsA方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: Episode

# 需要導入模塊: from aniDBmaper import AniDBMaper [as 別名]
# 或者: from aniDBmaper.AniDBMaper import getFileBitsA [as 別名]
class Episode(aniDBabstractObject):

    def __init__(self, aniDB, number=None, epid=None, filePath=None, fid=None, epno=None, paramsA=None, paramsF=None, load=False, calculate=False):
        if not aniDB and not number and not epid and not file and not fid:
            return None

        self.maper = AniDBMaper()
        self.epid = epid
        self.filePath = filePath
        self.fid = fid
        self.epno = epno
        if calculate:
            (self.ed2k, self.size) = self._calculate_file_stuff(self.filePath)


        if not paramsA:
            self.bitCodeA = "C000F0C0"
            self.paramsA = self.maper.getFileCodesA(self.bitCodeA)
        else:
            self.paramsA = paramsA
            self.bitCodeA = self.maper.getFileBitsA(self.paramsA)

        if not paramsF:
            self.bitCodeF = "7FF8FEF8"
            self.paramsF = self.maper.getFileCodesF(self.bitCodeF)
        else:
            self.paramsF = paramsF
            self.bitCodeF = self.maper.getFileBitsF(self.paramsF)

        super(Episode, self).__init__(aniDB, load)

    def load_data(self):
        """load the data from anidb"""
        if self.filePath and not (self.ed2k or self.size):
            (self.ed2k, self.size) = self._calculate_file_stuff(self.filePath)

        self.rawData = self.aniDB.file(fid=self.fid, size=self.size, ed2k=self.ed2k, aid=self.aid, aname=None, gid=None, gname=None, epno=self.epno, fmask=self.bitCodeF, amask=self.bitCodeA)
        self._fill(self.rawData.datalines[0])
        self._build_names()
        self.laoded = True

    def add_to_mylist(self, status=None):
        """
        status:
        0    unknown    - state is unknown or the user doesn't want to provide this information (default)
        1    on hdd    - the file is stored on hdd
        2    on cd    - the file is stored on cd
        3    deleted    - the file has been deleted or is not available for other reasons (i.e. reencoded)
        
        """
        if self.filePath and not (self.ed2k or self.size):
            (self.ed2k, self.size) = self._calculate_file_stuff(self.filePath)

        try:
            self.aniDB.mylistadd(size=self.size, ed2k=self.ed2k, state=status)
        except Exception, e :
            self.log(u"exception msg: " + str(e))
        else:
開發者ID:Davejje,項目名稱:SickRage,代碼行數:60,代碼來源:aniDBAbstracter.py


注:本文中的aniDBmaper.AniDBMaper.getFileBitsA方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。