def test_non_existant_show_raises_proper_exception(self): return try: quickinfo.fetch('yaddayadda') except Exception, e: assert isinstance(e, ShowNotFound) assert e.value == 'yaddayadda'
def latestepisode(self, irc, msg, args, show): """<show> Shows info on the latest episode of show """ latestreply = quickinfo.fetch(show) if 'Latest Episode' in latestreply: latestinfo = latestreply['Latest Episode'] properformat = ("The latest episode of {0} aired on {1} and \ was episode {2} named {3}.".format(show, latestinfo[2], latestinfo[0], latestinfo[1])) irc.reply(properformat) else: irc.reply(("There is no latest episode info available for \ {0}.".format(show)))
def nextepisode(self, irc, msg, args, show): """<show> Shows the next episode of show """ nextreply = quickinfo.fetch(show) if 'Next Episode' in nextreply and 'RFC3339' in nextreply: nextinfo = nextreply['Next Episode'] rfcvalue = nextreply['RFC3339'] properformat = ("The next episode of {0} will air on {1} and \ will be episode {2} named {3}. Time remaining until show airs: {4}".format(show, nextinfo[2], nextinfo[0], nextinfo[1], timeremaining(rfcvalue))) irc.reply(properformat) else: irc.reply("There is no next episode info for {0}.".format(show))
def test_showinfo(self): show = quickinfo.fetch('Doctor Who 2005') assert show['Show ID'] == '3332' assert show['Show Name'] == 'Doctor Who (2005)' assert show['Show URL'] == 'http://www.tvrage.com/DoctorWho_2005' assert show['Premiered'] == '2005' assert show['Started'] == 'Mar/26/2005' assert show['Ended'] == '' # Note: this test may break around X-mas 2010 #assert show['Latest Episode'] == \ # ['05x13', 'The Big Bang (2)', 'Jun/26/2010'] assert show['Country'] == 'United Kingdom' # hope the next one never breaks ;-) assert show['Status'] == 'Returning Series' assert show['Classification'] == 'Scripted' assert show['Genres'] == ['Action', 'Adventure', 'Sci-Fi'] assert show['Network'] == 'BBC One (United Kingdom)' assert show['Airtime'] == 'Saturday at 07:35 pm' # this may break assert show['Runtime'] == '60'
def test_showinfo(self): show = quickinfo.fetch('Doctor Who 2005') assert show['Show ID'] == '3332' assert show['Show Name'] == 'Doctor Who (2005)' assert show['Show URL'] == 'http://services.tvrage.com/DoctorWho_2005' assert show['Premiered'] == '2005' assert show['Started'] == 'Mar/26/2005' assert show['Ended'] == '' # Note: this test may break around X-mas 2010 #assert show['Latest Episode'] == \ # ['05x13', 'The Big Bang (2)', 'Jun/26/2010'] assert show['Country'] == 'United Kingdom' # hope the next one never breaks ;-) assert show['Status'] == 'Returning Series' assert show['Classification'] == 'Scripted' assert show['Genres'] == ['Action', 'Adventure', 'Sci-Fi'] assert show['Network'] == 'BBC One (United Kingdom)' assert show['Airtime'] == 'Saturday at 07:35 pm' # this may break assert show['Runtime'] == '60'
timeWithZoneus = us.localize(prevDateStrip) timeWithZonein = timeWithZoneus.astimezone(india) prevDateWithTime = timeWithZonein.strftime("%A at %I:%M %p %b/%d/%Y") (list["Latest Episode"])[2] = prevDateWithTime infoList.append( [list["Show Name"], (list["Next Episode"])[0], (list["Next Episode"])[1], (list["Next Episode"])[2], timeStamp] ) # all the desired information -- checkout pytvrage api for other information return list try: i = 0 while i <= 16: try: # print i --used for debugging seriesInfo = quickinfo.fetch(SeriesList[i]) series_time_fixed = timeFix( seriesInfo ) # Print series_time_fixed[] for having a look at various information returned by tvrage i = i + 1 except tvrage.util.TvrageError: # If server does not reply print "Retrying " # creating the key for sorting according to time of release def stamp(t): return t[4] sortedInfoList = sorted(infoList, key=stamp)
def test_epinfo(self): show_ep = quickinfo.fetch('Doctor Who 2005', ep='1x01') assert show_ep['Episode Info'] == ['01x01', 'Rose', '26/Mar/2005'] assert show_ep['Episode URL'] == \ 'http://www.tvrage.com/DoctorWho_2005/episodes/52117'
def test_non_existant_show_raises_proper_exception(self): try: quickinfo.fetch('yaddayadda') except Exception as e: assert isinstance(e, ShowNotFound) assert e.value == 'yaddayadda'
def test_epinfo(self): show_ep = quickinfo.fetch('Doctor Who 2005', ep='1x01') assert show_ep['Episode Info'] == ['01x01', 'Rose', '26/Mar/2005'] assert show_ep['Episode URL'] == \ 'http://services.tvrage.com/DoctorWho_2005/episodes/52117'
def test_begins_with_at(self): show = quickinfo.fetch('@midnight') assert show['Show ID'] == '23610'