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


Python utils.EpisodeInfo类代码示例

本文整理汇总了Python中tvnamer.utils.EpisodeInfo的典型用法代码示例。如果您正苦于以下问题:Python EpisodeInfo类的具体用法?Python EpisodeInfo怎么用?Python EpisodeInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了EpisodeInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: verify_name_gen

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,代码行数:28,代码来源:test_name_generation.py

示例2: test_no_name

def test_no_name():
    """Episode without a name
    """
    ep = EpisodeInfo(
        seriesname="Scrubs", seasonnumber=1, episodenumbers=[2], episodename=None, filename="scrubs.example.file.avi"
    )

    assertEquals(ep.generateFilename(), "Scrubs - [01x02].avi")
开发者ID:dbr,项目名称:tvnamer,代码行数:8,代码来源:test_name_generation.py

示例3: test_simple_no_ext

    def test_simple_no_ext(self):
        """Simple episode with out extension
        """
        ep = EpisodeInfo(
            seriesname="Scrubs", seasonnumber=1, episodenumbers=[2], episodename="My Mentor", filename=None
        )

        self.assertEquals(ep.generateFilename(), "Scrubs - [01x02] - My Mentor")
开发者ID:ansazz,项目名称:tvnamer,代码行数:8,代码来源:test_name_generation.py

示例4: test_no_series_number

    def test_no_series_number(self):
        """Episode without series number
        """
        ep = EpisodeInfo(
            seriesname="Scrubs", seasonnumber=None, episodenumbers=[2], episodename="My Mentor", filename=None
        )

        self.assertEquals(ep.generateFilename(), "Scrubs - [02] - My Mentor")
开发者ID:ansazz,项目名称:tvnamer,代码行数:8,代码来源:test_name_generation.py

示例5: get_episode_description

def get_episode_description(episode):
	populateFromTvdb(episode)
	ep = EpisodeInfo(
		seriesname = episode.seriesname,
        seasonnumber = episode.seasonnumber,
        episodenumbers = episode.episodenumbers,
		episodename = episode.episodename,
        filename = None)
	return ep.generateFilename()
开发者ID:feelinc,项目名称:transmission-scripts,代码行数:9,代码来源:torrent_ended.py

示例6: test_multi_episodes_continuous

    def test_multi_episodes_continuous(self):
        ep = EpisodeInfo(
            seriesname="Stargate SG-1",
            seasonnumber=1,
            episodenumbers=[1, 2],
            episodename=["Children of the Gods (1)", "Children of the Gods (2)"],
            filename="stargate.example.file.avi",
        )

        self.assertEquals(ep.generateFilename(), "Stargate SG-1 - [01x01-02] - Children of the Gods (1-2).avi")
开发者ID:ansazz,项目名称:tvnamer,代码行数:10,代码来源:test_name_generation.py

示例7: test_multi_episodes_seperate

def test_multi_episodes_seperate():
    """File with two episodes, but with different names
    """
    ep = EpisodeInfo(
        seriesname="Stargate SG-1",
        seasonnumber=1,
        episodenumbers=[2, 3],
        episodename=["Children of the Gods (2)", "The Enemy Within"],
        filename="stargate.example.file.avi",
    )

    assertEquals(ep.generateFilename(), "Stargate SG-1 - [01x02-03] - Children of the Gods (2), The Enemy Within.avi")
开发者ID:dbr,项目名称:tvnamer,代码行数:12,代码来源:test_name_generation.py

示例8: test_multi_episodes_continuous

def test_multi_episodes_continuous():
    """A two-part episode should not have the episode name repeated
    """
    ep = EpisodeInfo(
        seriesname="Stargate SG-1",
        seasonnumber=1,
        episodenumbers=[1, 2],
        episodename=["Children of the Gods (1)", "Children of the Gods (2)"],
        filename="stargate.example.file.avi",
    )

    assertEquals(ep.generateFilename(), "Stargate SG-1 - [01x01-02] - Children of the Gods (1-2).avi")
开发者ID:dbr,项目名称:tvnamer,代码行数:12,代码来源:test_name_generation.py

示例9: test_datedepisode_no_name_no_ext

def test_datedepisode_no_name_no_ext():
    """Dated EpisodeInfo with no name or extension
    """
    ep = EpisodeInfo(
        seriesname = 'Scrubs',
        eptype = 'dated',
        episodenumbers = [datetime.date(2010, 11, 23)],
        episodename = '',
        filename = '')

    assertEquals(
        ep.generateFilename(),
        'Scrubs - [2010-11-23]')
开发者ID:lahwaacz,项目名称:tvnamer,代码行数:13,代码来源:test_name_generation.py

示例10: test_noseason_no_name_no_ext

def test_noseason_no_name_no_ext():
    """NoSeason EpisodeInfo with no name or extension
    """
    ep = EpisodeInfo(
        seriesname = 'Scrubs',
        eptype = 'noseason',
        episodenumbers = [2],
        episodename = '',
        filename = '')

    assertEquals(
        ep.generateFilename(),
        'Scrubs - [02]')
开发者ID:lahwaacz,项目名称:tvnamer,代码行数:13,代码来源:test_name_generation.py

示例11: test_episode_no_name_no_ext

def test_episode_no_name_no_ext():
    """EpisodeInfo with no name or extension
    """
    ep = EpisodeInfo(
        seriesname = 'Scrubs',
        seasonnumber = 1,
        episodenumbers = [2],
        episodename = None,
        filename = None)

    assertEquals(
        ep.generateFilename(),
        'Scrubs - [01x02]')
开发者ID:eyezak,项目名称:videonamer,代码行数:13,代码来源:test_name_generation.py

示例12: test_simple_no_ext

def test_simple_no_ext():
    """Simple episode with out extension
    """
    ep = EpisodeInfo(
        seriesname = 'Scrubs',
        seasonnumber = 1,
        episodenumbers = [2],
        episodename = 'My Mentor',
        filename = None)

    assertEquals(
        ep.generateFilename(),
        'Scrubs - [01x02] - My Mentor')
开发者ID:eyezak,项目名称:videonamer,代码行数:13,代码来源:test_name_generation.py

示例13: test_downcase

def test_downcase():
    """Simple episode name, converted to lowercase
    """

    ep = EpisodeInfo(
        seriesname="Scrubs",
        seasonnumber=1,
        episodenumbers=[2],
        episodename="My Mentor",
        filename="scrubs.example.file.avi",
    )

    assertEquals(ep.generateFilename(lowercase=True), "scrubs - [01x02] - my mentor.avi")
开发者ID:dbr,项目名称:tvnamer,代码行数:13,代码来源:test_name_generation.py

示例14: test_multi_episodes_continuous

def test_multi_episodes_continuous():
    ep = EpisodeInfo(
        seriesname = 'Stargate SG-1',
        seasonnumber = 1,
        episodenumbers = [1, 2],
        episodename = [
            'Children of the Gods (1)',
            'Children of the Gods (2)'],
        filename = 'stargate.example.file.avi')

    assertEquals(
        ep.generateFilename(),
        'Stargate SG-1 - [01x01-02] - Children of the Gods (1-2).avi')
开发者ID:chainsawbike,项目名称:tvnamer,代码行数:13,代码来源:test_name_generation.py

示例15: test_multi_episodes_seperate

def test_multi_episodes_seperate():
    ep = EpisodeInfo(
        seriesname = 'Stargate SG-1',
        seasonnumber = 1,
        episodenumbers = [2, 3],
        episodename = [
            'Children of the Gods (2)',
            'The Enemy Within'],
        filename = 'stargate.example.file.avi')

    assertEquals(
        ep.generateFilename(),
        'Stargate SG-1 - [01x02-03] - Children of the Gods (2), The Enemy Within.avi')
开发者ID:chainsawbike,项目名称:tvnamer,代码行数:13,代码来源:test_name_generation.py


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