本文整理汇总了Python中aniDBmaper.AniDBMaper.getFileCodesA方法的典型用法代码示例。如果您正苦于以下问题:Python AniDBMaper.getFileCodesA方法的具体用法?Python AniDBMaper.getFileCodesA怎么用?Python AniDBMaper.getFileCodesA使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类aniDBmaper.AniDBMaper
的用法示例。
在下文中一共展示了AniDBMaper.getFileCodesA方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Episode
# 需要导入模块: from aniDBmaper import AniDBMaper [as 别名]
# 或者: from aniDBmaper.AniDBMaper import getFileCodesA [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: