本文整理汇总了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'])
示例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")
示例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")
示例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")
示例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()
示例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")
示例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")
示例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")
示例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]')
示例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]')
示例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]')
示例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')
示例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")
示例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')
示例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')