diff --git a/plugins/MoobotFactoids.py b/plugins/MoobotFactoids.py index 2f0761d03..7c509c72d 100644 --- a/plugins/MoobotFactoids.py +++ b/plugins/MoobotFactoids.py @@ -56,7 +56,7 @@ import ircutils import privmsgs import callbacks -import OwnerCommands +import Owner dbfilename = os.path.join(conf.dataDir, 'MoobotFactoids.db') @@ -131,12 +131,12 @@ class MoobotFactoids(callbacks.PrivmsgCommandAndRegexp): callbacks.PrivmsgCommandAndRegexp.__init__(self) self.makeDB(dbfilename) # Set up the "reply when not command" behavior - MiscCommands = OwnerCommands.loadPluginModule('MiscCommands') + Misc = Owner.loadPluginModule('Misc') # Gotta make sure we restore this when we unload - self.originalReplyWhenNotCommand = MiscCommands.replyWhenNotCommand + self.originalReplyWhenNotCommand = Misc.replyWhenNotCommand self.originalConfReplyWhenNotCommand = conf.replyWhenNotCommand conf.replyWhenNotCommand = True - MiscCommands.replyWhenNotCommand = self._checkFactoids + Misc.replyWhenNotCommand = self._checkFactoids def makeDB(self, filename): """create MoobotFactoids database and tables""" @@ -171,8 +171,8 @@ class MoobotFactoids(callbacks.PrivmsgCommandAndRegexp): self.db.close() del self.db # Recover from clobbering this command earlier - MiscCommands = OwnerCommands.loadPluginModule('MiscCommands') - MiscCommands.replyWhenNotCommand = self.originalReplyWhenNotCommand + Misc = Owner.loadPluginModule('Misc') + Misc.replyWhenNotCommand = self.originalReplyWhenNotCommand conf.replyWhenNotCommand = self.originalConfReplyWhenNotCommand def parseFactoid(self, fact): diff --git a/src/AdminCommands.py b/src/Admin.py similarity index 99% rename from src/AdminCommands.py rename to src/Admin.py index 98fb4fb54..15ff2b879 100755 --- a/src/AdminCommands.py +++ b/src/Admin.py @@ -48,7 +48,7 @@ import ircmsgs import privmsgs import callbacks -class AdminCommands(privmsgs.CapabilityCheckingPrivmsg): +class Admin(privmsgs.CapabilityCheckingPrivmsg): capability = 'admin' def join(self, irc, msg, args): """[,] [[,] ...] @@ -220,6 +220,6 @@ class AdminCommands(privmsgs.CapabilityCheckingPrivmsg): reportbug = privmsgs.thread(reportbug) -Class = AdminCommands +Class = Admin # vim:set shiftwidth=4 tabstop=8 expandtab textwidth=78: diff --git a/src/ChannelCommands.py b/src/Channel.py similarity index 99% rename from src/ChannelCommands.py rename to src/Channel.py index 3b2a6d2d4..11e718e1d 100755 --- a/src/ChannelCommands.py +++ b/src/Channel.py @@ -45,7 +45,7 @@ import ircutils import privmsgs import callbacks -class ChannelCommands(callbacks.Privmsg): +class Channel(callbacks.Privmsg): def op(self, irc, msg, args, channel): """[] @@ -352,6 +352,6 @@ class ChannelCommands(callbacks.Privmsg): irc.reply(msg, ', '.join(c.capabilities)) -Class = ChannelCommands +Class = Channel # vim:set shiftwidth=4 tabstop=8 expandtab textwidth=78: diff --git a/src/MiscCommands.py b/src/Misc.py similarity index 99% rename from src/MiscCommands.py rename to src/Misc.py index 0ba61219f..58781902c 100755 --- a/src/MiscCommands.py +++ b/src/Misc.py @@ -65,7 +65,7 @@ def replyWhenNotCommand(irc, msg, notCommands): irc.reply(msg, s) -class MiscCommands(callbacks.Privmsg): +class Misc(callbacks.Privmsg): def doPrivmsg(self, irc, msg): # This exists to be able to respond to attempts to command the bot # with a "That's not a command!" if the proper conf.variable is set. @@ -380,6 +380,6 @@ class MiscCommands(callbacks.Privmsg): irc.reply(msg, text, notice=True) -Class = MiscCommands +Class = Misc # vim:set shiftwidth=4 tabstop=8 expandtab textwidth=78: diff --git a/src/OwnerCommands.py b/src/Owner.py similarity index 98% rename from src/OwnerCommands.py rename to src/Owner.py index 85882e697..4747f601f 100644 --- a/src/OwnerCommands.py +++ b/src/Owner.py @@ -76,7 +76,7 @@ def loadPluginClass(irc, module): if hasattr(callback, 'configure'): callback.configure(irc) -class OwnerCommands(privmsgs.CapabilityCheckingPrivmsg): +class Owner(privmsgs.CapabilityCheckingPrivmsg): priority = ~sys.maxint # This must be first! capability = 'owner' def __init__(self): @@ -388,7 +388,7 @@ class OwnerCommands(privmsgs.CapabilityCheckingPrivmsg): except ValueError: irc.error(msg, ' must be an integer.') return - cbs = map(irc.getCallback, ['OwnerCommands', 'ConfigAfter376']) + cbs = map(irc.getCallback, ['Owner', 'ConfigAfter376']) newIrc = irclib.Irc(irc.nick, irc.user, irc.ident, irc.password, callbacks=cbs) driver = drivers.newDriver((server, port), newIrc) @@ -415,7 +415,7 @@ class OwnerCommands(privmsgs.CapabilityCheckingPrivmsg): -Class = OwnerCommands +Class = Owner # vim:set shiftwidth=4 tabstop=8 expandtab textwidth=78: diff --git a/src/UserCommands.py b/src/User.py similarity index 99% rename from src/UserCommands.py rename to src/User.py index 2c6c18c5e..26a63f795 100755 --- a/src/UserCommands.py +++ b/src/User.py @@ -41,7 +41,7 @@ import ircutils import privmsgs import callbacks -class UserCommands(callbacks.Privmsg): +class User(callbacks.Privmsg): def _checkNotChannel(self, irc, msg, password=' '): if password and ircutils.isChannel(msg.args[0]): irc.error(msg, conf.replyRequiresPrivacy) @@ -358,7 +358,7 @@ class UserCommands(callbacks.Privmsg): irc.error(msg, conf.replyIncorrectAuth) -Class = UserCommands +Class = User # vim:set shiftwidth=4 tabstop=8 expandtab textwidth=78: diff --git a/src/conf.py b/src/conf.py index 235022f44..83ba6a5e3 100644 --- a/src/conf.py +++ b/src/conf.py @@ -232,7 +232,7 @@ version ='0.73.1' commandsOnStart = [] # This is a dictionary mapping names to converter functions for use in the -# OwnerCommands.setconf command. +# Owner.setconf command. def mybool(s): """Converts a string read from the user into a bool, fuzzily.""" if s.capitalize() == 'False' or s == '0': diff --git a/src/template.py b/src/template.py index 9341adc8c..378029749 100755 --- a/src/template.py +++ b/src/template.py @@ -191,7 +191,7 @@ if __name__ == '__main__': import ircmsgs import drivers import callbacks - import OwnerCommands + import Owner class ConfigAfterConnect(irclib.IrcCallback): public = False @@ -208,7 +208,7 @@ if __name__ == '__main__': conf.commandsOnStart = map(callbacks.tokenize, conf.commandsOnStart) irc = irclib.Irc(nick, user, ident, password) - callback = OwnerCommands.Class() + callback = Owner.Class() callback.configure(irc) irc.addCallback(callback) irc.addCallback(ConfigAfterConnect(afterConnect)) diff --git a/test/test.py b/test/test.py index 62b1e8649..c458b27a6 100755 --- a/test/test.py +++ b/test/test.py @@ -59,7 +59,7 @@ import drivers import ircmsgs import ircutils import callbacks -import OwnerCommands +import Owner nicks = ['fatjim','scn','moshez','LordVan','MetaCosm','pythong','fishfart', 'alb','d0rt','jemfinch','StyxAlso','fors','deltab','gd', @@ -133,12 +133,12 @@ class PluginTestCase(unittest.TestCase): while self.irc.takeMsg(): pass if isinstance(self.plugins, str): - module = OwnerCommands.loadPluginModule(self.plugins) - cb = OwnerCommands.loadPluginClass(self.irc, module) + module = Owner.loadPluginModule(self.plugins) + cb = Owner.loadPluginClass(self.irc, module) else: for name in self.plugins: - module = OwnerCommands.loadPluginModule(name) - cb = OwnerCommands.loadPluginClass(self.irc, module) + module = Owner.loadPluginModule(name) + cb = Owner.loadPluginClass(self.irc, module) def tearDown(self): self.irc.die() diff --git a/test/test_AdminCommands.py b/test/test_Admin.py similarity index 97% rename from test/test_AdminCommands.py rename to test/test_Admin.py index 2fd54aca2..93ec9cf0e 100644 --- a/test/test_AdminCommands.py +++ b/test/test_Admin.py @@ -31,8 +31,8 @@ from test import * -class AdminCommandsTestCase(PluginTestCase, PluginDocumentation): - plugins = ('AdminCommands', 'MiscCommands') +class AdminTestCase(PluginTestCase, PluginDocumentation): + plugins = ('Admin', 'Misc') def testSetprefixchar(self): self.assertNotError('setprefixchar $') self.assertResponse('getprefixchar', "'$'") diff --git a/test/test_Alias.py b/test/test_Alias.py index 467162641..997907ca1 100644 --- a/test/test_Alias.py +++ b/test/test_Alias.py @@ -31,8 +31,7 @@ from test import * -Alias = OwnerCommands.loadPluginModule('Alias') - +Alias = Owner.loadPluginModule('Alias') class FunctionsTest(unittest.TestCase): def testFindAliasCommand(self): @@ -67,7 +66,7 @@ class FunctionsTest(unittest.TestCase): class AliasTestCase(ChannelPluginTestCase, PluginDocumentation): - plugins = ('Alias', 'Fun', 'Utilities', 'MiscCommands') + plugins = ('Alias', 'Fun', 'Utilities', 'Misc') def testAliasHelp(self): self.assertNotError('alias slashdot foo') self.assertRegexp('help slashdot', "Alias for 'foo'") diff --git a/test/test_ChannelCommands.py b/test/test_Channel.py similarity index 96% rename from test/test_ChannelCommands.py rename to test/test_Channel.py index 1695fc7f2..2534901b6 100644 --- a/test/test_ChannelCommands.py +++ b/test/test_Channel.py @@ -35,8 +35,8 @@ import conf import ircdb import ircmsgs -class ChannelCommandsTestCase(ChannelPluginTestCase, PluginDocumentation): - plugins = ('ChannelCommands',) +class ChannelTestCase(ChannelPluginTestCase, PluginDocumentation): + plugins = ('Channel',) def testUnban(self): self.assertError('unban foo!bar@baz') self.irc.feedMsg(ircmsgs.op(self.channel, self.nick)) diff --git a/test/test_ChannelDB.py b/test/test_ChannelDB.py index 71433c58f..2c5fac51a 100644 --- a/test/test_ChannelDB.py +++ b/test/test_ChannelDB.py @@ -38,7 +38,7 @@ except ImportError: if sqlite is not None: class ChannelDBTestCase(ChannelPluginTestCase, PluginDocumentation): - plugins = ('ChannelDB', 'MiscCommands', 'UserCommands') + plugins = ('ChannelDB', 'Misc', 'User') def setUp(self): ChannelPluginTestCase.setUp(self) self.prefix = 'foo!bar@baz' diff --git a/test/test_Dictionary.py b/test/test_Dictionary.py index 0794329ac..0a5e16f95 100644 --- a/test/test_Dictionary.py +++ b/test/test_Dictionary.py @@ -32,7 +32,7 @@ from test import * class DictionaryTestCase(PluginTestCase, PluginDocumentation): - plugins = ('Dictionary', 'MiscCommands') + plugins = ('Dictionary', 'Misc') def testDict(self): self.assertNotError('dict slash') self.assertNotRegexp('dict web1913 slash', 'foldoc') diff --git a/test/test_MiscCommands.py b/test/test_Misc.py similarity index 91% rename from test/test_MiscCommands.py rename to test/test_Misc.py index 7a539f553..b25bb9781 100644 --- a/test/test_MiscCommands.py +++ b/test/test_Misc.py @@ -31,8 +31,8 @@ from test import * -class MiscCommandsTestCase(ChannelPluginTestCase, PluginDocumentation): - plugins = ('MiscCommands', 'OwnerCommands', +class MiscTestCase(ChannelPluginTestCase, PluginDocumentation): + plugins = ('Misc', 'Owner', 'Utilities', 'Gameknot', 'Ctcp') def testReplyWhenNotCommand(self): try: @@ -74,8 +74,8 @@ class MiscCommandsTestCase(ChannelPluginTestCase, PluginDocumentation): self.assertError('help morehelp') def testList(self): - self.assertNotError('list MiscCommands') - self.assertNotError('list misccommands') + self.assertNotError('list Misc') + self.assertNotError('list misc') self.assertNotError('list') # If Ctcp changes to public, these tests will break. So if # the next assert fails, change the plugin we test for public/private @@ -84,7 +84,7 @@ class MiscCommandsTestCase(ChannelPluginTestCase, PluginDocumentation): self.failIf(self.irc.getCallback(name).public) self.assertNotRegexp('list', name) self.assertRegexp('list --private', name) - self.assertNotRegexp('list OwnerCommands', '_exec') + self.assertNotRegexp('list Owner', '_exec') def testVersion(self): self.assertNotError('version') @@ -102,15 +102,15 @@ class MiscCommandsTestCase(ChannelPluginTestCase, PluginDocumentation): self.assertNotError('getprefixchar') def testPlugin(self): - self.assertResponse('plugin plugin', 'MiscCommands') + self.assertResponse('plugin plugin', 'Misc') def testTell(self): m = self.getMsg('tell foo [plugin tell]') self.failUnless(m.args[0] == 'foo') - self.failUnless('MiscCommands' in m.args[1]) + self.failUnless('Misc' in m.args[1]) m = self.getMsg('tell #foo [plugin tell]') self.failUnless(m.args[0] == '#foo') - self.failUnless('MiscCommands' in m.args[1]) + self.failUnless('Misc' in m.args[1]) def testLast(self): self.feedMsg('foo bar baz') diff --git a/test/test_MoobotFactoids.py b/test/test_MoobotFactoids.py index 60e561c26..09cdc86bb 100644 --- a/test/test_MoobotFactoids.py +++ b/test/test_MoobotFactoids.py @@ -38,7 +38,7 @@ except ImportError: if sqlite is not None: class FactoidsTestCase(PluginTestCase, PluginDocumentation): - plugins = ('MiscCommands', 'MoobotFactoids', 'UserCommands') + plugins = ('Misc', 'MoobotFactoids', 'User') def setUp(self): PluginTestCase.setUp(self) # Create a valid user to use @@ -184,7 +184,7 @@ if sqlite is not None: self.assertError('no moo is qux') # class DunnoTestCase(PluginTestCase, PluginDocumentation): -# plugins = ('MiscCommands', 'MoobotFactoids', 'UserCommands') +# plugins = ('Misc', 'MoobotFactoids', 'User') # def testDunno(self): # self.assertNotError('apfasdfjoia') # Should say a dunno, no error diff --git a/test/test_Notes.py b/test/test_Notes.py index 6b5182d6c..f0c60363b 100644 --- a/test/test_Notes.py +++ b/test/test_Notes.py @@ -41,7 +41,7 @@ except ImportError: if sqlite is not None: class NotesTestCase(PluginTestCase, PluginDocumentation): - plugins = ('Notes', 'MiscCommands', 'UserCommands') + plugins = ('Notes', 'Misc', 'User') def testHelps(self): self.assertNotError('help sendnote') self.assertNotError('list Notes') diff --git a/test/test_OwnerCommands.py b/test/test_Owner.py similarity index 86% rename from test/test_OwnerCommands.py rename to test/test_Owner.py index 8d047bf4b..6f3f922ef 100644 --- a/test/test_OwnerCommands.py +++ b/test/test_Owner.py @@ -32,10 +32,10 @@ from test import * import conf -import OwnerCommands +import Owner -class OwnerCommandsTestCase(PluginTestCase, PluginDocumentation): - plugins = ('OwnerCommands',) +class OwnerTestCase(PluginTestCase, PluginDocumentation): + plugins = ('Owner',) def testEval(self): try: originalConfAllowEval = conf.allowEval @@ -82,20 +82,20 @@ class OwnerCommandsTestCase(PluginTestCase, PluginDocumentation): self.assertError('unset foo') def testLoad(self): - self.assertError('load OwnerCommands') - self.assertNotError('load MiscCommands') - self.assertNotError('list OwnerCommands') + self.assertError('load Owner') + self.assertNotError('load Misc') + self.assertNotError('list Owner') def testReload(self): - self.assertError('reload MiscCommands') - self.assertNotError('load MiscCommands') - self.assertNotError('reload MiscCommands') + self.assertError('reload Misc') + self.assertNotError('load Misc') + self.assertNotError('reload Misc') def testUnload(self): - self.assertError('unload MiscCommands') - self.assertNotError('load MiscCommands') - self.assertNotError('unload MiscCommands') - self.assertError('unload MiscCommands') + self.assertError('unload Misc') + self.assertNotError('load Misc') + self.assertNotError('unload Misc') + self.assertError('unload Misc') def testSetconf(self): self.assertRegexp('setconf', 'confDir') @@ -137,9 +137,9 @@ class OwnerCommandsTestCase(PluginTestCase, PluginDocumentation): class FunctionsTestCase(unittest.TestCase): def testLoadPluginModule(self): - self.assertRaises(ImportError, OwnerCommands.loadPluginModule, 'asldj') - self.failUnless(OwnerCommands.loadPluginModule('OwnerCommands')) - self.failUnless(OwnerCommands.loadPluginModule('ownercommands')) + self.assertRaises(ImportError, Owner.loadPluginModule, 'asldj') + self.failUnless(Owner.loadPluginModule('Owner')) + self.failUnless(Owner.loadPluginModule('ownercommands')) # vim:set shiftwidth=4 tabstop=8 expandtab textwidth=78: diff --git a/test/test_Status.py b/test/test_Status.py index 4b6cb9ad8..4b592348a 100644 --- a/test/test_Status.py +++ b/test/test_Status.py @@ -34,7 +34,7 @@ from test import * import world class StatusTestCase(PluginTestCase, PluginDocumentation): - plugins = ('Status', 'OwnerCommands') + plugins = ('Status', 'Owner') def testBestuptime(self): self.assertNotRegexp('bestuptime', '33 years') self.assertNotError('unload Status') diff --git a/test/test_Todo.py b/test/test_Todo.py index fb62231d0..f3faa1cd9 100644 --- a/test/test_Todo.py +++ b/test/test_Todo.py @@ -38,7 +38,7 @@ except ImportError: if sqlite is not None: class TodoTestCase(PluginTestCase, PluginDocumentation): - plugins = ('Todo', 'UserCommands') + plugins = ('Todo', 'User') def setUp(self): PluginTestCase.setUp(self) # Create a valid user to use diff --git a/test/test_Topic.py b/test/test_Topic.py index 8b030bb33..63097aa28 100644 --- a/test/test_Topic.py +++ b/test/test_Topic.py @@ -32,7 +32,7 @@ from test import * class TopicTestCase(PluginTestCase, PluginDocumentation): - plugins = ('Topic', 'AdminCommands') + plugins = ('Topic', 'Admin') def testAddtopic(self): _ = self.getMsg('join #foo') _ = self.getMsg(' ') # Get the WHO. diff --git a/test/test_UserCommands.py b/test/test_User.py similarity index 96% rename from test/test_UserCommands.py rename to test/test_User.py index 28444adec..180f87e7f 100644 --- a/test/test_UserCommands.py +++ b/test/test_User.py @@ -33,8 +33,8 @@ from test import * import ircdb -class UserCommandsTestCase(PluginTestCase, PluginDocumentation): - plugins = ('UserCommands',) +class UserTestCase(PluginTestCase, PluginDocumentation): + plugins = ('User',) prefix1 = 'somethingElse!user@host.tld' prefix2 = 'EvensomethingElse!user@host.tld' def testRegisterUnregister(self): diff --git a/test/test_callbacks.py b/test/test_callbacks.py index 88f3499be..3bce3b0cb 100644 --- a/test/test_callbacks.py +++ b/test/test_callbacks.py @@ -163,7 +163,7 @@ class FunctionsTestCase(unittest.TestCase): class PrivmsgTestCase(ChannelPluginTestCase): - plugins = ('Utilities', 'OwnerCommands', 'MiscCommands') + plugins = ('Utilities', 'Owner', 'Misc') conf.allowEval = True timeout = 2 def testEmptySquareBrackets(self):