diff --git a/willie/modules/admin.py b/willie/modules/admin.py index 8b35ef460a..d9f481efcb 100644 --- a/willie/modules/admin.py +++ b/willie/modules/admin.py @@ -198,7 +198,7 @@ def set_config(bot, trigger): setattr(getattr(bot.config, section), option, value) -@willie.module.command('save') +@willie.module.commands('save') @willie.module.example('.save') def save_config(bot, trigger): """Save state of willies config object to the configuration file.""" diff --git a/willie/modules/adminchannel.py b/willie/modules/adminchannel.py index 778b088a88..9a3711cf93 100644 --- a/willie/modules/adminchannel.py +++ b/willie/modules/adminchannel.py @@ -10,7 +10,7 @@ """ import re -from willie.module import command, commands, priority +from willie.module import commands, priority def setup(bot): @@ -19,7 +19,7 @@ def setup(bot): bot.db.preferences.add_columns(['topic_mask']) -@command('op') +@commands('op') def op(bot, trigger): """ Command to op users in a room. If no nick is given, @@ -33,7 +33,7 @@ def op(bot, trigger): bot.write(['MODE', channel, "+o", nick]) -@command('deop') +@commands('deop') def deop(bot, trigger): """ Command to deop users in a room. If no nick is given, @@ -47,7 +47,7 @@ def deop(bot, trigger): bot.write(['MODE', channel, "-o", nick]) -@command('voice') +@commands('voice') def voice(bot, trigger): """ Command to voice users in a room. If no nick is given, @@ -61,7 +61,7 @@ def voice(bot, trigger): bot.write(['MODE', channel, "+v", nick]) -@command('devoice') +@commands('devoice') def devoice(bot, trigger): """ Command to devoice users in a room. If no nick is given, @@ -75,7 +75,7 @@ def devoice(bot, trigger): bot.write(['MODE', channel, "-v", nick]) -@command('kick') +@commands('kick') @priority('high') def kick(bot, trigger): """ @@ -124,7 +124,7 @@ def configureHostMask(mask): return '' -@command('ban') +@commands('ban') @priority('high') def ban(bot, trigger): """ @@ -151,7 +151,7 @@ def ban(bot, trigger): bot.write(['MODE', channel, '+b', banmask]) -@command('unban') +@commands('unban') def unban(bot, trigger): """ This give admins the ability to unban a user. @@ -177,7 +177,7 @@ def unban(bot, trigger): bot.write(['MODE', channel, '-b', banmask]) -@command('quiet') +@commands('quiet') def quiet(bot, trigger): """ This gives admins the ability to quiet a user. @@ -203,7 +203,7 @@ def quiet(bot, trigger): bot.write(['MODE', channel, '+q', quietmask]) -@command('unquiet') +@commands('unquiet') def unquiet(bot, trigger): """ This gives admins the ability to unquiet a user. @@ -262,7 +262,7 @@ def kickban(bot, trigger): bot.write(['KICK', channel, nick, ' :', reason]) -@command('topic') +@commands('topic') def topic(bot, trigger): """ This gives ops the ability to change the topic. @@ -297,7 +297,7 @@ def topic(bot, trigger): bot.write(('TOPIC', channel + ' :' + topic)) -@command('tmask') +@commands('tmask') def set_mask(bot, trigger): """ Set the mask to use for .topic in the current channel. %s is used to allow @@ -312,7 +312,7 @@ def set_mask(bot, trigger): bot.say("Gotcha, " + trigger.nick) -@command('showmask') +@commands('showmask') def show_mask(bot, trigger): """Show the topic mask for the current channel.""" if not trigger.isop: @@ -325,7 +325,7 @@ def show_mask(bot, trigger): bot.say("%s") -@command('isop') +@commands('isop') def isop(bot, trigger): """Show if you are an operator in the current channel""" if trigger.isop: diff --git a/willie/modules/announce.py b/willie/modules/announce.py index d724179f8c..035473a604 100644 --- a/willie/modules/announce.py +++ b/willie/modules/announce.py @@ -5,10 +5,10 @@ Licensed under the Eiffel Forum License 2. """ -from willie.module import command, example +from willie.module import commands, example -@command('announce') +@commands('announce') @example('.announce Some important message here') def announce(bot, trigger): """ diff --git a/willie/modules/calc.py b/willie/modules/calc.py index c52dd848d0..a8e21159d6 100644 --- a/willie/modules/calc.py +++ b/willie/modules/calc.py @@ -9,7 +9,7 @@ import re from willie import web -from willie.module import command, commands, example +from willie.module import commands, example from socket import timeout import string import HTMLParser @@ -46,7 +46,7 @@ def c(bot, trigger): bot.reply(result) -@command('py') +@commands('py') @example('.py len([1,2,3])') def py(bot, trigger): """Evaluate a Python expression.""" diff --git a/willie/modules/clock.py b/willie/modules/clock.py index 02f50f087d..b2f6dd0e5b 100644 --- a/willie/modules/clock.py +++ b/willie/modules/clock.py @@ -8,7 +8,7 @@ """ import pytz import datetime -from willie.module import commands, command, example +from willie.module import commands, example def setup(bot): @@ -61,7 +61,7 @@ def f_time(bot, trigger): bot.say(now.strftime(tformat or "%F - %T%Z")) -@command('settz') +@commands('settz') @example('.settz America/New_York') def update_user(bot, trigger): """ @@ -125,7 +125,7 @@ def update_user_format(bot, trigger): bot.reply("I can't remember that; I don't have a database.") -@command('channeltz') +@commands('channeltz') @example('.chantz America/New_York') def update_channel(bot, trigger): """ diff --git a/willie/modules/countdown.py b/willie/modules/countdown.py index 39e798c70a..a3073df7d4 100644 --- a/willie/modules/countdown.py +++ b/willie/modules/countdown.py @@ -5,11 +5,11 @@ http://willie.dfbta.net """ -from willie.module import command, NOLIMIT +from willie.module import commands, NOLIMIT import datetime -@command('countdown') +@commands('countdown') def generic_countdown(bot, trigger): """ .countdown - displays a countdown to a given date. diff --git a/willie/modules/dice.py b/willie/modules/dice.py index 9acec102e6..b09d17caf3 100644 --- a/willie/modules/dice.py +++ b/willie/modules/dice.py @@ -14,9 +14,9 @@ seed() -@willie.module.command("roll") -@willie.module.command("dice") -@willie.module.command("d") +@willie.module.commands("roll") +@willie.module.commands("dice") +@willie.module.commands("d") @willie.module.priority("medium") def dice(bot, trigger): """ @@ -95,9 +95,9 @@ def rollDice(diceroll): return sorted(result) # returns a set of integers. -@willie.module.command("choice") -@willie.module.command("ch") -@willie.module.command("choose") +@willie.module.commands("choice") +@willie.module.commands("ch") +@willie.module.commands("choose") @willie.module.priority("medium") def choose(bot, trigger): """ diff --git a/willie/modules/etymology.py b/willie/modules/etymology.py index 7a5187eef4..f6260d3eca 100644 --- a/willie/modules/etymology.py +++ b/willie/modules/etymology.py @@ -8,7 +8,7 @@ import re from willie import web -from willie.module import command, example, NOLIMIT +from willie.module import commands, example, NOLIMIT etyuri = 'http://etymonline.com/?term=%s' etysearch = 'http://etymonline.com/?search=%s' @@ -71,7 +71,7 @@ def etymology(word): return sentence + ' - ' + (etyuri % word) -@command('ety') +@commands('ety') @example('word') def f_etymology(bot, trigger): """Look up the etymology of a word""" diff --git a/willie/modules/help.py b/willie/modules/help.py index baee7e93d4..309900bd28 100644 --- a/willie/modules/help.py +++ b/willie/modules/help.py @@ -6,12 +6,12 @@ http://willie.dftba.net """ -from willie.module import command, rule, example, priority +from willie.module import commands, rule, example, priority @rule('$nick' '(?i)(help|doc) +([A-Za-z]+)(?:\?+)?$') @example('.help tell') -@command('help') +@commands('help') @priority('low') def help(bot, trigger): """Shows a command's documentation, and possibly an example.""" @@ -27,7 +27,7 @@ def help(bot, trigger): bot.say('e.g. ' + bot.doc[name][1]) -@command('commands') +@commands('commands') @priority('low') def commands(bot, trigger): """Return a list of bot's commands""" diff --git a/willie/modules/radio.py b/willie/modules/radio.py index 0b7947d7c6..0939c69a72 100644 --- a/willie/modules/radio.py +++ b/willie/modules/radio.py @@ -9,7 +9,7 @@ from time import sleep from xml.dom.minidom import parseString import willie.web as web -from willie.module import command +from willie.module import commands import xml.dom.minidom @@ -84,7 +84,7 @@ def nextSong(bot, trigger): bot.say('No songs are queued up.') -@command('radio') +@commands('radio') def radio(bot, trigger): """ Radio functions, valid parameters: on, off, song, now, next, soon, stats. """ global checkSongs, current_song, radioURL diff --git a/willie/modules/reddit-info.py b/willie/modules/reddit-info.py index 04dd17e421..4a5c23a011 100644 --- a/willie/modules/reddit-info.py +++ b/willie/modules/reddit-info.py @@ -6,7 +6,7 @@ This module provides special tools for reddit, namely showing detailed info about reddit posts """ -from willie.module import command, rule, example, NOLIMIT +from willie.module import commands, rule, example, NOLIMIT import praw import re domain = r'https?://(?:www\.|np\.)?reddit\.com' @@ -45,7 +45,7 @@ def rpost_info(bot, trigger, match=None): #If you change this, you'll have to change some other things... -@command('redditor') +@commands('redditor') def redditor_info(bot, trigger, match=None): """Show information about the given Redditor""" commanded = re.match(bot.config.prefix + 'redditor', trigger) diff --git a/willie/modules/remind.py b/willie/modules/remind.py index 41435d7f2e..5cd2e1d82e 100644 --- a/willie/modules/remind.py +++ b/willie/modules/remind.py @@ -14,7 +14,7 @@ import pytz import codecs from datetime import tzinfo, timedelta, datetime -from willie.module import command, example, NOLIMIT +from willie.module import commands, example, NOLIMIT def filename(self): @@ -120,7 +120,7 @@ def monitor(bot): periods = '|'.join(scaling.keys()) -@command('in') +@commands('in') @example('.in 3h45m Go to class') def remind(bot, trigger): """Gives you a reminder in the given amount of time.""" @@ -151,7 +151,7 @@ def remind(bot, trigger): create_reminder(bot, trigger, duration, reminder, tzi) -@command('at') +@commands('at') @example('.at 13:47 Do your homework!') def at(bot, trigger): """ diff --git a/willie/modules/seen.py b/willie/modules/seen.py index c58597aa60..d40e8028d6 100644 --- a/willie/modules/seen.py +++ b/willie/modules/seen.py @@ -12,7 +12,7 @@ import datetime import pytz from willie.tools import Ddict, Nick -from willie.module import command, rule, priority +from willie.module import commands, rule, priority seen_dict = Ddict(dict) @@ -28,7 +28,7 @@ def get_user_time(bot, nick): return (pytz.timezone(tz.strip()), tformat or '%Y-%m-%d %H:%M:%S %Z') -@command('seen') +@commands('seen') def seen(bot, trigger): """Reports when and where the user was last seen.""" if not trigger.group(2): diff --git a/willie/modules/unicode_info.py b/willie/modules/unicode_info.py index de07199fe3..0e89194781 100644 --- a/willie/modules/unicode_info.py +++ b/willie/modules/unicode_info.py @@ -7,10 +7,10 @@ http://willie.dfbta.net """ import unicodedata -from willie.module import command, example, NOLIMIT +from willie.module import commands, example, NOLIMIT -@command('u') +@commands('u') @example('.u 203D') def codepoint(bot, trigger): arg = trigger.group(2).strip() diff --git a/willie/modules/units.py b/willie/modules/units.py index 18f0633ec2..7fa85dcb3c 100644 --- a/willie/modules/units.py +++ b/willie/modules/units.py @@ -6,7 +6,7 @@ Licensed under the Eiffel Forum License 2. """ -from willie.module import command, commands, example, NOLIMIT +from willie.module import commands, example, NOLIMIT import re find_temp = re.compile('(-?[0-9]*\.?[0-9]*)[ °]*(K|C|F)', re.IGNORECASE) @@ -29,7 +29,7 @@ def k_to_c(temp): return temp - 273.15 -@command('temp') +@commands('temp') @example('.temp 100F') def temperature(bot, trigger): """ diff --git a/willie/modules/url.py b/willie/modules/url.py index e0a55439a6..032092a7f0 100644 --- a/willie/modules/url.py +++ b/willie/modules/url.py @@ -10,7 +10,7 @@ import re from htmlentitydefs import name2codepoint import willie.web as web -from willie.module import command, rule +from willie.module import commands, rule import urllib2 import urlparse @@ -75,7 +75,7 @@ def setup(bot): (exclusion_char)) -@command('title') +@commands('title') def title_command(bot, trigger): """ Show the title or URL information for the given URL, or the last URL seen diff --git a/willie/modules/version.py b/willie/modules/version.py index 0276170399..4996bad23a 100644 --- a/willie/modules/version.py +++ b/willie/modules/version.py @@ -20,7 +20,7 @@ def git_info(): return commit, author, date -@willie.module.command('version') +@willie.module.commands('version') def version(bot, trigger): """Display the latest commit version, if Willie is running in a git repo.""" commit, author, date = git_info() diff --git a/willie/modules/weather.py b/willie/modules/weather.py index 05babf5865..5e81d030bb 100644 --- a/willie/modules/weather.py +++ b/willie/modules/weather.py @@ -11,7 +11,7 @@ import urllib import json from willie import web -from willie.module import command, commands, example +from willie.module import commands, example from lxml import etree import feedparser @@ -133,7 +133,7 @@ def get_wind(parsed): return description + ' ' + str(speed) + 'kt (' + degrees + ')' -@command('weather') +@commands('weather') @example('.weather London') def weather(bot, trigger): """.weather location - Show the weather at the given location.""" diff --git a/willie/modules/xkcd.py b/willie/modules/xkcd.py index 9b413bdd7e..5a0b138474 100644 --- a/willie/modules/xkcd.py +++ b/willie/modules/xkcd.py @@ -10,13 +10,13 @@ import random from willie.modules.search import google_search from willie.modules.url import find_title -from willie.module import command +from willie.module import commands import urllib2 from lxml import etree import re -@command('xkcd') +@commands('xkcd') def xkcd(bot, trigger): """ .xkcd - Finds an xkcd comic strip. Takes one of 3 inputs: