pepepepep8
This commit is contained in:
parent
cd5ae1d32b
commit
223bef30a5
|
@ -51,6 +51,5 @@ def bancount(inp):
|
|||
if not out:
|
||||
return "The user \x02{}\x02 has no bans.".format(user)
|
||||
else:
|
||||
# dat string.
|
||||
return "Bans for \x02{}\x02: ".format(user) + ", ".join(out) + ". More info " \
|
||||
"at {}".format(user_url)
|
||||
|
|
|
@ -8,9 +8,9 @@ def refresh_cache():
|
|||
soup = http.get_soup('http://www.fmylife.com/random/')
|
||||
|
||||
for e in soup.find_all('div', {'class': 'post article'}):
|
||||
id = int(e['id'])
|
||||
fml_id = int(e['id'])
|
||||
text = ''.join(e.find('p').find_all(text=True))
|
||||
fml_cache.append((id, text))
|
||||
fml_cache.append((fml_id, text))
|
||||
|
||||
# do an initial refresh of the cache
|
||||
refresh_cache()
|
||||
|
@ -21,9 +21,9 @@ def fml(inp, reply=None):
|
|||
"""fml -- Gets a random quote from fmyfife.com."""
|
||||
|
||||
# grab the last item in the fml cache and remove it
|
||||
id, text = fml_cache.pop()
|
||||
fml_id, text = fml_cache.pop()
|
||||
# reply with the fml we grabbed
|
||||
reply('(#{}) {}'.format(id, text))
|
||||
reply('(#{}) {}'.format(fml_id, text))
|
||||
# refresh fml cache if its getting empty
|
||||
if len(fml_cache) < 3:
|
||||
refresh_cache()
|
||||
|
|
|
@ -12,12 +12,8 @@ def metacritic(inp):
|
|||
"""mc [all|movie|tv|album|x360|ps3|pc|gba|ds|3ds|wii|vita|wiiu|xone|ps4] <title>
|
||||
Gets rating for <title> from metacritic on the specified medium."""
|
||||
|
||||
|
||||
# if the results suck, it's metacritic's fault
|
||||
|
||||
args = inp.strip()
|
||||
|
||||
|
||||
game_platforms = ('x360', 'ps3', 'pc', 'gba', 'ds', '3ds', 'wii',
|
||||
'vita', 'wiiu', 'xone', 'ps4')
|
||||
|
||||
|
@ -76,7 +72,6 @@ def metacritic(inp):
|
|||
'''
|
||||
|
||||
# get the proper result element we want to pull data from
|
||||
|
||||
result = None
|
||||
|
||||
if not doc.find_class('query_results'):
|
||||
|
|
|
@ -13,7 +13,7 @@ details_url = base_url + "plugins/bukkit/{}"
|
|||
categories = http.get_json("http://api.bukget.org/3/categories")
|
||||
|
||||
count_total = sum([cat["count"] for cat in categories])
|
||||
count_categores = {cat["name"].lower() : int(cat["count"]) for cat in categories} # dict conps!
|
||||
count_categories = {cat["name"].lower() : int(cat["count"]) for cat in categories} # dict comps!
|
||||
|
||||
|
||||
class BukgetError(Exception):
|
||||
|
@ -99,7 +99,8 @@ def format_output(data):
|
|||
else:
|
||||
line_a = u"\x02{}\x02, by \x02{}\x02 ({}) \x02{}".format(name, authors, stage, url)
|
||||
|
||||
line_b = u"Last release: \x02v{}\x02 for \x02{}\x02 at {} \x02{}\x02".format(version_number, bukkit_versions, last_update, link)
|
||||
line_b = u"Last release: \x02v{}\x02 for \x02{}\x02 at {} \x02{}\x02".format(version_number, bukkit_versions,
|
||||
last_update, link)
|
||||
|
||||
return line_a, line_b
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ def mcwiki(inp):
|
|||
return "No results found."
|
||||
|
||||
# we remove items with a '/' in the name, because
|
||||
# gamepedia uses subpages for different languages
|
||||
# gamepedia uses sub-pages for different languages
|
||||
# for some stupid reason
|
||||
items = [item for item in j[1] if not "/" in item]
|
||||
|
||||
|
|
Reference in New Issue