本文整理汇总了Python中tvnamer.utils.EpisodeInfo.populateFromTvdb方法的典型用法代码示例。如果您正苦于以下问题:Python EpisodeInfo.populateFromTvdb方法的具体用法?Python EpisodeInfo.populateFromTvdb怎么用?Python EpisodeInfo.populateFromTvdb使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tvnamer.utils.EpisodeInfo
的用法示例。
在下文中一共展示了EpisodeInfo.populateFromTvdb方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: verify_name_gen
# 需要导入模块: from tvnamer.utils import EpisodeInfo [as 别名]
# 或者: from tvnamer.utils.EpisodeInfo import populateFromTvdb [as 别名]
def verify_name_gen(curtest, tvdb_instance):
if "seasonnumber" in curtest:
ep = EpisodeInfo(
filename = curtest['input'],
eptype = 'default',
seriesname = curtest['parsedseriesname'],
seasonnumber = curtest['seasonnumber'],
episodenumbers = curtest['episodenumbers'])
elif any([isinstance(x, datetime.date) for x in curtest['episodenumbers']]):
ep = EpisodeInfo(
filename = curtest['input'],
eptype = 'dated',
seriesname = curtest['parsedseriesname'],
episodenumbers = curtest['episodenumbers'])
else:
ep = EpisodeInfo(
filename = curtest['input'],
eptype = 'noseason',
seriesname = curtest['parsedseriesname'],
episodenumbers = curtest['episodenumbers'])
ep.populateFromTvdb(tvdb_instance, force_name = curtest.get("force_name"))
assert ep.seriesname is not None, "Corrected series name was none"
assert ep.episodename is not None, "Episode name was None"
assertEquals(ep.seriesname, curtest['correctedseriesname'])
assertEquals(ep.episodename, curtest['episodenames'])
示例2: verify_name_gen
# 需要导入模块: from tvnamer.utils import EpisodeInfo [as 别名]
# 或者: from tvnamer.utils.EpisodeInfo import populateFromTvdb [as 别名]
def verify_name_gen(curtest, tvdb_instance):
if "seasonnumber" in curtest:
ep = EpisodeInfo(
seriesname=curtest["parsedseriesname"],
seasonnumber=curtest["seasonnumber"],
episodenumbers=curtest["episodenumbers"],
)
elif any([isinstance(x, datetime.date) for x in curtest["episodenumbers"]]):
ep = DatedEpisodeInfo(seriesname=curtest["parsedseriesname"], episodenumbers=curtest["episodenumbers"])
else:
ep = NoSeasonEpisodeInfo(seriesname=curtest["parsedseriesname"], episodenumbers=curtest["episodenumbers"])
ep.populateFromTvdb(tvdb_instance, force_name=curtest.get("force_name"))
assert ep.seriesname is not None, "Corrected series name was none"
assert ep.episodename is not None, "Episode name was None"
assertEquals(ep.seriesname, curtest["correctedseriesname"])
assertEquals(ep.episodename, curtest["episodenames"])