Skip to content
This repository was archived by the owner on Oct 23, 2019. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions cloudbot/util/tokenbucket.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ def __init__(self, _capacity, fill_rate):
:param _capacity: The total amount of token the bucket can contain
:param fill_rate: The rate at which tokens regenerate. (fill_rate per second)
"""
"""tokens is the total tokens in the bucket. fill_rate is the
rate in tokens/second that the bucket will be refilled."""
self.capacity = float(_capacity)
self._tokens = float(_capacity)
self.fill_rate = float(fill_rate)
Expand Down
2 changes: 1 addition & 1 deletion plugins/amazon.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def amazon_url(match, reply):

@hook.command("amazon", "az")
def amazon(text, reply, _parsed=False):
"""<query> -- Searches Amazon for query"""
"""<query> - Searches Amazon for query"""
headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, '
'like Gecko) Chrome/41.0.2228.0 Safari/537.36',
Expand Down
4 changes: 2 additions & 2 deletions plugins/chan_track.py
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@ def updateusers(bot):

@hook.command(permissions=["botcontrol"], autohelp=False)
def cleanusers(bot):
"""
"""- Clean user data

:type bot: cloudbot.bot.CloudBot
"""
Expand All @@ -661,7 +661,7 @@ def cleanusers(bot):

@hook.command(permissions=["botcontrol"], autohelp=False)
def clearusers(bot):
"""
"""- Clear all user data

:type bot: cloudbot.bot.CloudBot
"""
Expand Down
1 change: 1 addition & 0 deletions plugins/core/check_conn.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ def on_connect(conn):
@hook.command("lagcheck", autohelp=False, permissions=["botcontrol"])
@hook.periodic(5)
def lag_check(bot, admin_log):
"""- Manually update lag times for all connections"""
now = time.time()
for conn in bot.connections.values():
if conn.connected:
Expand Down
5 changes: 5 additions & 0 deletions plugins/core/regex_chans.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,16 +92,19 @@ def change_status(text, chan, nick, db, conn, message, notice, status):

@hook.command(autohelp=False, permissions=["botcontrol"])
def enableregex(text, db, conn, chan, nick, message, notice):
"""[chan] - Enable regex hooks in [chan] (default: current channel)"""
return change_status(text, chan, nick, db, conn, message, notice, True)


@hook.command(autohelp=False, permissions=["botcontrol"])
def disableregex(text, db, conn, chan, nick, message, notice):
"""[chan] - Disable regex hooks in [chan] (default: current channel)"""
return change_status(text, chan, nick, db, conn, message, notice, False)


@hook.command(autohelp=False, permissions=["botcontrol"])
def resetregex(text, db, conn, chan, nick, message, notice):
"""[chan] - Reset regex hook status in [chan] (default: current channel)"""
text = text.strip().lower()
if not text:
channel = chan
Expand All @@ -118,6 +121,7 @@ def resetregex(text, db, conn, chan, nick, message, notice):

@hook.command(autohelp=False, permissions=["botcontrol"])
def regexstatus(text, conn, chan):
"""[chan] - Get status of regex hooks in [chan] (default: current channel)"""
text = text.strip().lower()
if not text:
channel = chan
Expand All @@ -136,6 +140,7 @@ def regexstatus(text, conn, chan):

@hook.command(autohelp=False, permissions=["botcontrol"])
def listregex(conn):
"""- List non-default regex statuses for channels"""
values = []
for (conn_name, chan), status in status_cache.values():
if conn_name != conn.name:
Expand Down
1 change: 1 addition & 0 deletions plugins/cryptocurrency.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ def crypto_command(text):

@hook.command("currencies", "currencylist", autohelp=False)
def currency_list():
"""- List all available currencies from the API"""
currencies = sorted(set((obj["symbol"], obj["id"]) for obj in api.currencies), key=itemgetter(0))
lst = [
'{: <10} {}'.format(symbol, name) for symbol, name in currencies
Expand Down
2 changes: 1 addition & 1 deletion plugins/cypher.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def decode(password, encoded, notice):

@hook.command("cypher", "cipher")
def cypher(text, message, event):
"""<pass> <string> -- cyphers <string> with <password>"""
"""<pass> <string> - cyphers <string> with <password>"""
split = text.split(None, 1)
if len(split) < 2:
event.notice_doc()
Expand Down
2 changes: 1 addition & 1 deletion plugins/feeds.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def format_item(item):

@hook.command("feed", "rss", "news")
def rss(text):
"""<feed> -- Gets the first three items from the RSS/ATOM feed <feed>."""
"""<feed> - Gets the first three items from the RSS/ATOM feed <feed>."""
limit = 3

t = text.lower().strip()
Expand Down
4 changes: 2 additions & 2 deletions plugins/google_cse.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

@hook.command('gse')
def gse(text):
"""<query> -- Returns first Google search result for <query>."""
"""<query> - Returns first Google search result for <query>."""
dev_key = bot.config.get_api_key("google_dev_key")
cx = bot.config.get_api_key("google_cse_id")
if not dev_key:
Expand Down Expand Up @@ -50,7 +50,7 @@ def gse(text):

@hook.command('gseis', 'image')
def gse_gis(text):
"""<query> -- Returns first Google Images result for <query>."""
"""<query> - Returns first Google Images result for <query>."""
dev_key = bot.config.get_api_key("google_dev_key")
cx = bot.config.get_api_key("google_cse_id")
if not dev_key:
Expand Down
8 changes: 4 additions & 4 deletions plugins/ignore.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def get_user(conn, text):

@hook.command(permissions=["ignore", "chanop"])
def ignore(text, db, chan, conn, notice, admin_log, nick):
"""<nick|mask> -- ignores all input from <nick|mask> in this channel."""
"""<nick|mask> - ignores all input from <nick|mask> in this channel."""
target = get_user(conn, text)

if is_ignored(conn.name, chan, target):
Expand All @@ -123,7 +123,7 @@ def ignore(text, db, chan, conn, notice, admin_log, nick):

@hook.command(permissions=["ignore", "chanop"])
def unignore(text, db, chan, conn, notice, nick, admin_log):
"""<nick|mask> -- un-ignores all input from <nick|mask> in this channel."""
"""<nick|mask> - un-ignores all input from <nick|mask> in this channel."""
target = get_user(conn, text)

if not is_ignored(conn.name, chan, target):
Expand All @@ -136,7 +136,7 @@ def unignore(text, db, chan, conn, notice, nick, admin_log):

@hook.command(permissions=["botcontrol"])
def global_ignore(text, db, conn, notice, nick, admin_log):
"""<nick|mask> -- ignores all input from <nick|mask> in ALL channels."""
"""<nick|mask> - ignores all input from <nick|mask> in ALL channels."""
target = get_user(conn, text)

if is_ignored(conn.name, "*", target):
Expand All @@ -149,7 +149,7 @@ def global_ignore(text, db, conn, notice, nick, admin_log):

@hook.command(permissions=["botcontrol"])
def global_unignore(text, db, conn, notice, nick, admin_log):
"""<nick|mask> -- un-ignores all input from <nick|mask> in ALL channels."""
"""<nick|mask> - un-ignores all input from <nick|mask> in ALL channels."""
target = get_user(conn, text)

if not is_ignored(conn.name, "*", target):
Expand Down
2 changes: 1 addition & 1 deletion plugins/issafe.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

@hook.command()
def issafe(text):
"""<website> -- Checks the website against Google's Safe Browsing List."""
"""<website> - Checks the website against Google's Safe Browsing List."""
if urlparse(text).scheme not in ['https', 'http']:
return "Check your URL (it should be a complete URI)."

Expand Down
2 changes: 1 addition & 1 deletion plugins/locate.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def check_status(status):

@hook.command("locate", "maps")
def locate(text):
"""<location> -- Finds <location> on Google Maps."""
"""<location> - Finds <location> on Google Maps."""
dev_key = bot.config.get_api_key("google_dev_key")
if not dev_key:
return "This command requires a Google Developers Console API key."
Expand Down
1 change: 1 addition & 0 deletions plugins/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ async def console_log(bot, event):

@hook.command("flushlog", permissions=["botcontrol"])
def flush_log():
"""- Flush all log streams"""
for name, stream in stream_cache.values():
stream.flush()
for name, stream in raw_cache.values():
Expand Down
5 changes: 5 additions & 0 deletions plugins/profiling.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,13 @@ def get_thread_dump():

@hook.command("threaddump", autohelp=False, permissions=["botcontrol"])
async def threaddump_command():
"""- Return a full thread dump"""
return get_thread_dump()


@hook.command("objtypes", autohelp=False, permissions=["botcontrol"])
def show_types():
"""- Print object type data to the console"""
if objgraph is None:
return "objgraph not installed"
objgraph.show_most_common_types(limit=20)
Expand All @@ -88,6 +90,7 @@ def show_types():

@hook.command("objgrowth", autohelp=False, permissions=["botcontrol"])
def show_growth():
"""- Print object growth data to the console"""
if objgraph is None:
return "objgraph not installed"
objgraph.show_growth(limit=10)
Expand All @@ -96,6 +99,7 @@ def show_growth():

@hook.command("pymsummary", autohelp=False, permissions=["botcontrol"])
def pympler_summary():
"""- Print object summary data to the console"""
if pympler is None:
return "pympler not installed / not enabled"
all_objects = pympler.muppy.get_objects()
Expand All @@ -106,6 +110,7 @@ def pympler_summary():

@hook.command("pymdiff", autohelp=False, permissions=["botcontrol"])
def pympler_diff():
"""- Print object diff data to the console"""
if pympler is None:
return "pympler not installed / not enabled"
tr.print_diff()
Expand Down
1 change: 1 addition & 0 deletions plugins/randomusefulwebsites.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

@hook.command('randomusefulsite', 'randomwebsite', 'randomsite', 'discuvver')
def randomusefulwebsite():
"""- Return a random useful website from discuvver.com"""
response = requests.head(url, headers=headers, allow_redirects=True)
response.raise_for_status()
return response.url
2 changes: 1 addition & 1 deletion plugins/remind.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ async def check_reminders(bot, async_call, db):

@hook.command('remind', 'reminder', 'in')
async def remind(text, nick, chan, db, conn, event, async_call):
"""<1 minute, 30 seconds>: <do task> -- reminds you to <do task> in <1 minute, 30 seconds>"""
"""<1 minute, 30 seconds>: <do task> - reminds you to <do task> in <1 minute, 30 seconds>"""

count = len([x for x in reminder_cache if x[0] == conn.name and x[3] == nick.lower()])

Expand Down
4 changes: 2 additions & 2 deletions plugins/soundcloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def format_group(group, show_url=True):
# CLOUDBOT HOOKS
@hook.command("soundcloud", "sc")
def soundcloud(text):
"""<query> -- Searches for tracks on SoundCloud."""
"""<query> - Searches for tracks on SoundCloud."""
api_key = bot.config.get_api_key("soundcloud")
if not api_key:
return "This command requires a SoundCloud API key."
Expand All @@ -170,7 +170,7 @@ def soundcloud(text):

@hook.command("scuser")
def soundcloud_user(text):
"""<query> -- Searches for users on SoundCloud."""
"""<query> - Searches for users on SoundCloud."""
api_key = bot.config.get_api_key("soundcloud")
if not api_key:
return "This command requires a SoundCloud API key."
Expand Down
2 changes: 1 addition & 1 deletion plugins/twitch.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def twitch_url(match, reply):

@hook.command('twitch', 'twitchtv')
def twitch(text, reply):
"""<channel name> -- Retrieves the channel and shows it's offline/offline status"""
"""<channel name> - Retrieves the channel and shows it's offline/offline status"""
text = text.split("/")[-1]
if test_name(text):
location = text
Expand Down
Loading