Skip to content

Commit bfdb749

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

15 files changed

Lines changed: 23 additions & 779 deletions

cloudbot/util/timeformat.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ def timesince(d, now=None, count=2, accuracy=6, simple=False):
1111
This function has a number of optional arguments that can be combined:
1212
1313
SIMPLE: displays the time in a simple format
14-
>>> timesince(SECONDS)
14+
>> timesince(SECONDS)
1515
1 hour, 2 minutes and 34 seconds
16-
>>> timesince(SECONDS, simple=True)
16+
>> timesince(SECONDS, simple=True)
1717
1h 2m 34s
1818
1919
COUNT: how many periods should be shown (default 3)
20-
>>> timesince(SECONDS)
20+
>> timesince(SECONDS)
2121
147 years, 9 months and 8 weeks
22-
>>> timesince(SECONDS, count=6)
22+
>> timesince(SECONDS, count=6)
2323
147 years, 9 months, 7 weeks, 18 hours, 12 minutes and 34 seconds
2424
"""
2525

@@ -67,15 +67,15 @@ def format_time(seconds, count=3, accuracy=6, simple=False):
6767
This function has a number of optional arguments that can be combined:
6868
6969
SIMPLE: displays the time in a simple format
70-
>>> format_time(SECONDS)
70+
>> format_time(SECONDS)
7171
1 hour, 2 minutes and 34 seconds
72-
>>> format_time(SECONDS, simple=True)
72+
>> format_time(SECONDS, simple=True)
7373
1h 2m 34s
7474
7575
COUNT: how many periods should be shown (default 3)
76-
>>> format_time(SECONDS)
76+
>> format_time(SECONDS)
7777
147 years, 9 months and 8 weeks
78-
>>> format_time(SECONDS, count=6)
78+
>> format_time(SECONDS, count=6)
7979
147 years, 9 months, 7 weeks, 18 hours, 12 minutes and 34 seconds
8080
"""
8181

cloudbot/util/tokenbucket.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44

55
class TokenBucket(object):
66
"""An implementation of the token bucket algorithm.
7-
>>> bucket = TokenBucket(80, 0.5)
8-
>>> bucket.consume(10)
7+
>> bucket = TokenBucket(80, 0.5)
8+
>> bucket.consume(10)
99
True
10-
>>> bucket.consume(90)
10+
>> bucket.consume(90)
1111
False
1212
"""
1313

config.default.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@
7777
"imgur_client_id": "",
7878
"imgur_client_secret": "",
7979
"wunderground": "",
80-
"googletranslate": "",
8180
"rdio_key": "",
8281
"rdio_secret": "",
8382
"google_dev_key": ""

plugins/core_tracker.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ def bot_joined_channel(conn, chan):
2929
conn.history[chan] = deque(maxlen=100)
3030

3131

32-
3332
@asyncio.coroutine
3433
@hook.irc_raw("KICK")
3534
def on_kick(conn, chan, target, loop):

plugins/history.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def track_history(event, message_time, conn):
5454
history.append(data)
5555

5656

57-
@hook.event([EventType.message, EventType.action], ignorebots=False, singlethread=True)
57+
@hook.event(EventType.message, EventType.action, singlethread=True)
5858
def chat_tracker(event, db, conn):
5959
"""
6060
:type db: sqlalchemy.orm.Session
@@ -111,7 +111,7 @@ def seen(text, nick, chan, db, event, conn):
111111
if last_seen[0] != text.lower(): # for glob matching
112112
text = last_seen[0]
113113
if last_seen[2][0:1] == "\x01":
114-
return '{} was last seen {} ago: * {} {}'.format(text, reltime, text, last_seen[2][8:-1])
114+
return '{} was edast seen {} ago: * {} {}'.format(text, reltime, text, last_seen[2][8:-1])
115115
else:
116116
return '{} was last seen {} ago saying: {}'.format(text, reltime, last_seen[2])
117117
else:

plugins/imgur.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ def imgur(text):
113113

114114
@hook.command("imguralbum", "multiimgur", "imgalbum", "album", autohelp=False)
115115
def imguralbum(text, conn):
116-
"""[search term] / [/r/subreddit] / [/user/username] / memes / random - returns a link to lots of random images based on your input. if
117-
no input is given the bot will get images from the imgur frontpage """
116+
"""[search term] / [/r/subreddit] / [/user/username] / memes / random - returns a link to lots of random images
117+
based on your input. if no input is given the bot will get images from the imgur frontpage """
118118
text = text.strip().lower()
119119

120120
if not imgur_api:

plugins/karma.py

Lines changed: 0 additions & 1 deletion
This file was deleted.

plugins/lastfm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,4 +125,4 @@ def lastfmcompare(text, bot):
125125
artist_string = "\x02In Common:\x02 " + ", ".join(artists) if artists else ""
126126

127127
return "Musical compatibility between \x02{}\x02 and \x02{}\x02: {} (\x02{}%\x02)".format(user1, user2, level,
128-
score), artist_string
128+
score), artist_string

plugins/minecraft_bukget.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def format_output(data):
127127
line_a = "\x02{}\x02, by \x02{}\x02 ({}) - {}".format(name, authors, stage, url)
128128

129129
line_b = "Last release: \x02v{}\x02 for \x02{}\x02 at {} - {}".format(version_number, bukkit_versions,
130-
last_update, link)
130+
last_update, link)
131131

132132
return line_a, line_b
133133

plugins/mylife.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ def refresh_mlia_cache(loop):
4040
mlia_cache.append((mlia_id, mlia_text))
4141

4242

43-
4443
@asyncio.coroutine
4544
@hook.on_start()
4645
def initial_refresh(loop):

0 commit comments

Comments
 (0)