当前位置: 首页>>代码示例>>Python>>正文


Python EpisodeInfo.populateFromTvdb方法代码示例

本文整理汇总了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'])
开发者ID:lahwaacz,项目名称:tvnamer,代码行数:30,代码来源:test_name_generation.py

示例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"])
开发者ID:dbr,项目名称:tvnamer,代码行数:21,代码来源:test_name_generation.py


注:本文中的tvnamer.utils.EpisodeInfo.populateFromTvdb方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。