From 79b4f15b45406871e0a95ddb61120255d3ca0d43 Mon Sep 17 00:00:00 2001 From: neersighted Date: Tue, 28 Feb 2012 21:58:38 -0800 Subject: [PATCH] pep8 --- plugins/whois.py | 18 ++++++++++-------- plugins/wordoftheday.py | 4 +++- plugins/youtube.py | 6 ++++-- 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/plugins/whois.py b/plugins/whois.py index 858a26c..bf0426b 100755 --- a/plugins/whois.py +++ b/plugins/whois.py @@ -1,5 +1,6 @@ from util import pywhois, hook + @hook.command def whois(inp, say=None): ".whois -- Look up ownership infomation for " @@ -13,28 +14,29 @@ def whois(inp, say=None): try: domain_name = w.domain_name[0] except IndexError, e: - domain_name="none." + domain_name = "None" try: expiration_date = w.expiration_date[0] except IndexError, e: - expiration_date="none." + expiration_date = "None" try: creation_date = w.creation_date[0] except IndexError, e: - creation_date="none." + creation_date = "None" try: registrant_email = w.emails[0] except: - registrant_email="none." + registrant_email = "None" try: administrative_email = w.emails[1] except: - administrative_email="none." - - say('Domain recognised! %s was registered on \x02%s\x02 and will expire on \x02%s\x02' % (domain_name, creation_date, expiration_date)) - say('Registrant email: %s Administrative email: %s' % (registrant_email, administrative_email)) + administrative_email = "None" + say("Domain recognised! %s was registered on \x02%s\x02 and will "\ + "expire on \x02%s\x02" % (domain_name, creation_date, expiration_date)) + say("Registrant email: %s "\ + "Administrative email: %s" % (registrant_email, administrative_email)) diff --git a/plugins/wordoftheday.py b/plugins/wordoftheday.py index 5f877eb..3d4b631 100755 --- a/plugins/wordoftheday.py +++ b/plugins/wordoftheday.py @@ -2,6 +2,7 @@ import re from util import hook, http, misc from BeautifulSoup import BeautifulSoup + @hook.command(autohelp=False) def word(inp, say=False, nick=False): ".word -- Gets the word of the day." @@ -15,4 +16,5 @@ def word(inp, say=False, nick=False): #definitions = re.findall(r':' # r' *([^<]+)', content) - say("(%s) The word of the day is: \x02%s\x02 (%s)" % (nick, word, function)) + say("(%s) The word of the day is:"\ + " \x02%s\x02 (%s)" % (nick, word, function)) diff --git a/plugins/youtube.py b/plugins/youtube.py index 1c1cb76..82f54a9 100755 --- a/plugins/youtube.py +++ b/plugins/youtube.py @@ -50,11 +50,12 @@ def get_video_description(vid_id): return out + def GetInHMS(seconds): hours = seconds / 3600 - seconds -= 3600*hours + seconds -= 3600 * hours minutes = seconds / 60 - seconds -= 60*minutes + seconds -= 60 * minutes if hours == 0: return "%02d:%02d" % (minutes, seconds) return "%02d:%02d:%02d" % (hours, minutes, seconds) @@ -64,6 +65,7 @@ def GetInHMS(seconds): def youtube_url(match): return get_video_description(match.group(1)) + @hook.command('yt') @hook.command('y') @hook.command