Skip to content

Commit f0e2248

Browse files
committed
Make plugins PEP-8 compliant
1 parent bfdb749 commit f0e2248

2 files changed

Lines changed: 12 additions & 15 deletions

File tree

plugins/quote.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ def get_quote_by_nick(db, nick, num=False):
9393
.order_by(qtable.c.time)\
9494
.limit(1) \
9595
.offset((num - 1))
96-
quote = db.execute(query).fetchall()[0]
97-
return format_quote(quote, num, count)
96+
data = db.execute(query).fetchall()[0]
97+
return format_quote(data, num, count)
9898

9999

100100
def get_quote_by_nick_chan(db, chan, nick, num=False):
@@ -118,8 +118,8 @@ def get_quote_by_nick_chan(db, chan, nick, num=False):
118118
.order_by(qtable.c.time) \
119119
.limit(1) \
120120
.offset((num - 1))
121-
quote = db.execute(query).fetchall()[0]
122-
return format_quote(quote, num, count)
121+
data = db.execute(query).fetchall()[0]
122+
return format_quote(data, num, count)
123123

124124

125125
def get_quote_by_chan(db, chan, num=False):
@@ -141,13 +141,12 @@ def get_quote_by_chan(db, chan, num=False):
141141
.order_by(qtable.c.time)\
142142
.limit(1) \
143143
.offset((num - 1))
144-
quote = db.execute(query).fetchall()[0]
145-
return format_quote(quote, num, count)
144+
data = db.execute(query).fetchall()[0]
145+
return format_quote(data, num, count)
146146

147147

148-
@hook.command('q')
149-
@hook.command()
150-
def quote(text, nick='', chan='', db=None, notice=None, conn=None):
148+
@hook.command('q', 'quote')
149+
def quote(text, nick, chan, db, notice):
151150
"""[#chan] [nick] [#n] OR add <nick> <message> - gets the [#n]th quote by <nick> (defaulting to random)
152151
OR adds <message> as a quote for <nick> in the caller's channel"""
153152

plugins/whois.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,29 +9,27 @@
99
def whois(text):
1010
domain = text.strip().lower()
1111

12-
whois = pythonwhois.get_whois(domain, normalized=True)
12+
data = pythonwhois.get_whois(domain, normalized=True)
1313

1414
info = []
1515

1616
try:
17-
i = "\x02Registrar\x02: {}".format(whois["registrar"][0])
17+
i = "\x02Registrar\x02: {}".format(data["registrar"][0])
1818
info.append(i)
1919
except:
2020
pass
2121

2222
try:
23-
i = "\x02Registered\x02: {}".format(whois["creation_date"][0].strftime("%d-%m-%Y"))
23+
i = "\x02Registered\x02: {}".format(data["creation_date"][0].strftime("%d-%m-%Y"))
2424
info.append(i)
2525
except:
2626
pass
2727

2828
try:
29-
i = "\x02Expires\x02: {}".format(whois["expiration_date"][0].strftime("%d-%m-%Y"))
29+
i = "\x02Expires\x02: {}".format(data["expiration_date"][0].strftime("%d-%m-%Y"))
3030
info.append(i)
3131
except:
3232
pass
3333

34-
pprint(whois)
35-
3634
info_text = ", ".join(info)
3735
return "{} - {}".format(domain, info_text)

0 commit comments

Comments
 (0)