def check_msg(self, channame, chan, user, msg): #if chan.is_oper(user) or chan.is_voiced(user): if any(map(lambda x: x.search(user) is not None, usernameFilters)): for r in msgFilters: m = r.match(msg) if m: src = m.group(1) url = m.group(2) try: show, ep = showdb.splitShowEp(src) showdb.add(show, ep, src, url, method="IRC:%s" % channame) return except Exception, e: showdb.parseFailed('IRC', src, url, channame) for r in msgFiltersIgnore: m = r.match(msg) if m: return print "IRC: NOMATCH", channame, user, msg
def parseTitleBased(show, feed_url): name, ep = showdb.splitShowEp(show['title']) links = list(show['links']) links.sort(key=grade_link) return showdb.add(name, ep, show['title'] + " " + feed_url, links[0]['href'], method='RSS')
showtool alias <oldshow> <newshow> -- add an alias to automatically rename one show to another showtool cleanup -- perform database cleanup showtool query <sql-query> -- execute a raw query on the database ''' sys.exit(1) searchname = ' '.join(args) + '%' searchep = "%" try: searchname, searchep = showdb.splitShowEp(' '.join(args)) except: pass isfilteredshow = showdb.mkshowfilter() mapmap = lambda fn, ll: map(lambda l: map(fn, l), ll) db = showdb.opendb() rv = db.cursor() rows = [] if cmd in ["list", "ls", "search", "find"]: print "Searching for name like", searchname, "episode like", searchep rv = db.execute(''' SELECT name,max(episode) as "last ep", count(distinct episode) as "eps",sum(downloaded>0) as dls,date(max(created),'unixepoch') as updated, '' as sub FROM shows WHERE name LIKE ? AND episode LIKE ?