diff --git a/plugins/brainfuck.py b/plugins/brainfuck.py index 1c68b57..a7dc12e 100644 --- a/plugins/brainfuck.py +++ b/plugins/brainfuck.py @@ -1,5 +1,5 @@ -'''brainfuck interpreter adapted from (public domain) code at -http://brainfuck.sourceforge.net/brain.py''' +"""brainfuck interpreter adapted from (public domain) code at +http://brainfuck.sourceforge.net/brain.py""" import re import random diff --git a/plugins/fact.py b/plugins/fact.py index ab05f17..1d48ae7 100644 --- a/plugins/fact.py +++ b/plugins/fact.py @@ -2,7 +2,7 @@ from util import hook, http, web @hook.command(autohelp=False) -def fact(inp, say=False, nick=False): +def fact(inp): """fact -- Gets a random fact from OMGFACTS.""" attempts = 0 @@ -20,10 +20,10 @@ def fact(inp, say=False, nick=False): response = soup.find('a', {'class': 'surprise'}) link = response['href'] - fact = ''.join(response.find(text=True)) + fact_data = ''.join(response.find(text=True)) - if fact: - fact = fact.strip() + if fact_data: + fact_data = fact_data.strip() break else: if attempts > 2: @@ -34,4 +34,4 @@ def fact(inp, say=False, nick=False): url = web.try_isgd(link) - return "{} - {}".format(fact, url) + return "{} - {}".format(fact_data, url) diff --git a/plugins/help.py b/plugins/help.py index 4a4fd47..08001a5 100644 --- a/plugins/help.py +++ b/plugins/help.py @@ -3,7 +3,7 @@ from util import hook @hook.command(autohelp=False) -def help(inp, notice=None, input=None, conn=None, bot=None): +def help(inp, notice=None, conn=None, bot=None): """help -- Gives a list of commands/help for a command.""" funcs = {} diff --git a/plugins/hulu.py b/plugins/hulu.py index 0b69788..46d31ee 100644 --- a/plugins/hulu.py +++ b/plugins/hulu.py @@ -10,7 +10,7 @@ def hulu_url(match): data = http.get_json("http://www.hulu.com/api/oembed.json?url=http://www.hulu.com" + match.group(3)) showname = data['title'].split("(")[-1].split(")")[0] title = data['title'].split(" (")[0] - return "{}: {} - {}".format(showname, title, timeformat.timeformat(int(data['duration']))) + return "{}: {} - {}".format(showname, title, timeformat.format_time(int(data['duration']))) @hook.command('hulu') @@ -21,7 +21,7 @@ def hulu_search(inp): data = result.find('results').find('videos').find('video') showname = data.find('show').find('name').text title = data.find('title').text - duration = timeformat.timeformat(int(float(data.find('duration').text))) + duration = timeformat.format_time(int(float(data.find('duration').text))) description = data.find('description').text rating = data.find('content-rating').text return "{}: {} - {} - {} ({}) {}".format(showname, title, description, duration, rating, diff --git a/plugins/imgur.py b/plugins/imgur.py index 80efbca..8db3b96 100644 --- a/plugins/imgur.py +++ b/plugins/imgur.py @@ -18,7 +18,7 @@ def is_valid(data): @hook.command(autohelp=False) def imgur(inp): - "imgur [subreddit] -- Gets the first page of imgur images from [subreddit] and returns a link to them. If [subreddit] is undefined, return any imgur images" + """imgur [subreddit] -- Gets the first page of imgur images from [subreddit] and returns a link to them. If [subreddit] is undefined, return any imgur images""" if inp: # see if the input ends with "nsfw" show_nsfw = inp.endswith(" nsfw") diff --git a/plugins/isup.py b/plugins/isup.py index 454b8f5..5fc95d6 100644 --- a/plugins/isup.py +++ b/plugins/isup.py @@ -5,7 +5,7 @@ from util import hook, http, urlnorm @hook.command def isup(inp): - "isup -- uses isup.me to see if a site is up or not" + """isup -- uses isup.me to see if a site is up or not""" # slightly overcomplicated, esoteric URL parsing scheme, auth, path, query, fragment = urlparse.urlsplit(inp.strip()) diff --git a/plugins/metacritic.py b/plugins/metacritic.py index e32059d..92d0933 100644 --- a/plugins/metacritic.py +++ b/plugins/metacritic.py @@ -41,36 +41,6 @@ def metacritic(inp): except HTTPError: return 'error fetching results' - ''' result format: - -- game result, with score - -- subsequent results are the same structure, without first_result class -