From a66034f8523d990c5845e5dbf44eebc2a7fca1f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0t=C4=9Bp=C3=A1n=20N=C4=9Bmec?= Date: Sun, 16 Aug 2009 23:17:05 +0200 Subject: [PATCH] Fix some typos/wordings. Signed-off-by: James Vega --- docs/ADVANCED_PLUGIN_CONFIG | 6 +++--- docs/ADVANCED_PLUGIN_TESTING | 20 ++++++++++---------- docs/USING_WRAP | 24 +++++++++++++----------- plugins/Anonymous/test.py | 2 +- plugins/Config/plugin.py | 5 +++-- plugins/Plugin/plugin.py | 6 +++--- plugins/String/plugin.py | 2 +- plugins/URL/config.py | 8 ++++---- scripts/supybot | 10 +++++----- src/callbacks.py | 4 ++-- src/irclib.py | 8 ++++---- src/ircmsgs.py | 2 +- src/ircutils.py | 12 ++++++------ src/log.py | 2 +- src/test.py | 2 +- src/utils/gen.py | 6 +++--- 16 files changed, 61 insertions(+), 58 deletions(-) diff --git a/docs/ADVANCED_PLUGIN_CONFIG b/docs/ADVANCED_PLUGIN_CONFIG index 9134d2f71..e81285583 100644 --- a/docs/ADVANCED_PLUGIN_CONFIG +++ b/docs/ADVANCED_PLUGIN_CONFIG @@ -48,12 +48,12 @@ config.py code imports the four most useful functions from that module: - acceptEmpty (optional): Defaults to False. Specifies whether or not to accept no input as an answer. - * "anything" is basically a special case of except which takes anything + * "anything" is basically a special case of expect which takes anything (including no input) and has no default value specified. It takes only one argument: - prompt: The text to be displayed - * "something" is also a special case of except, requiring some input and + * "something" is also a special case of expect, requiring some input and allowing an optional default. It takes the following arguments: - prompt: The text to be displayed - default (optional): Defaults to None. The default value to use if @@ -63,7 +63,7 @@ config.py code imports the four most useful functions from that module: a "y" for yes, or "n" for no. It takes the following arguments: - prompt: The text to be displayed - default (optional): Defaults to None. Default value to use if the - user doesn't put anything. + user doesn't input anything. All of these functions, with the exception of "yn", return whatever string results as the answer whether it be input from the user or specified as the diff --git a/docs/ADVANCED_PLUGIN_TESTING b/docs/ADVANCED_PLUGIN_TESTING index 688426ae5..5d39f33f9 100644 --- a/docs/ADVANCED_PLUGIN_TESTING +++ b/docs/ADVANCED_PLUGIN_TESTING @@ -146,16 +146,16 @@ would self.nick be set. As for the rest of the method, you'll notice a few things that are available to the plugin test author. self.prefix refers to the hostmask of the hypothetical test user which will be "talking" to the bot, issuing commands. -We set it to some generically fake hostmask, and then we use feedMsg to feed -it a private message (using the bot's nick, accessible via self.nick) to -register the username "tester" with the password "moo". We have to do it this -way (rather than what you'll find out is the standard way of issuing commands -to the bot in test cases a little later) because registration must be done in -private. And lastly, since feedMsg doesn't dequeue any messages from the bot -after getting fed a message, we perform a getMsg to get the response. You're -not expected to know all this yet, but do take note of it since using these -methods in test-writing is not uncommon. These utility methods as well as all -of the available assertions are covered in the next section. +We set it to some generically fake hostmask, and then we use feedMsg to send +a private message (using the bot's nick, accessible via self.nick) to the bot +registering the username "tester" with the password "moo". We have to do it +this way (rather than what you'll find out is the standard way of issuing +commands to the bot in test cases a little later) because registration must be +done in private. And lastly, since feedMsg doesn't dequeue any messages from +the bot after being fed a message, we perform a getMsg to get the response. +You're not expected to know all this yet, but do take note of it since using +these methods in test-writing is not uncommon. These utility methods as well as +all of the available assertions are covered in the next section. So, now in any of the test methods we write, we'll be able to count on the fact that there will be a registered user "tester" with a password of "moo", diff --git a/docs/USING_WRAP b/docs/USING_WRAP index 0b84c37d1..a5a33d775 100644 --- a/docs/USING_WRAP +++ b/docs/USING_WRAP @@ -124,11 +124,11 @@ Customizing Wrap Converters alone are a pretty powerful tool, but for even more advanced (yet simpler!) argument handling you may want to use contexts. Contexts describe how the converters are applied to the arguments, while the converters themselves -actually do the actual parsing and validation. +do the actual parsing and validation. For example, one of the contexts is "optional". By using this context, you're saying that a given argument is not required, and if the supplied converter -doesn't find something it likes, we should use some default. Yet another +doesn't find anything it likes, we should use some default. Yet another example is the "reverse" context. This context tells the supplied converter to look at the last argument and work backwards instead of the normal first-to-last way of looking at arguments. @@ -139,14 +139,16 @@ will work as-is. However, contexts let you do some very powerful things in very easy ways, and are a good thing to know how to use. Now, how do you use them? Well, they are in the global namespace of -src/commands.py, so your previous import line will import them all, so you can +src/commands.py, so your previous import line will import them all; you can call them just as you call wrap. In fact, the way you use them is you simply -call the context function you want to use, passing in the converter and its -arguments in as arguments. It's quite simple. Here's an example: +call the context function you want to use, with the converter (and its +arguments) as arguments. It's quite simple. Here's an example: commandname = wrap(commandname, [optional('int'), many('something')]) -In this example, our command is looking for an optional integer argument first. Then, after that, any number of arguments which can be anything (as long as they are something, of course). +In this example, our command is looking for an optional integer argument first. +Then, after that, any number of arguments which can be anything (as long as +they are something, of course). Do note, however, that the type of the arguments that are returned can be changed if you apply a context to it. So, optional("int") may very well return @@ -176,9 +178,9 @@ optional, the default value is shown. "int", type="integer", p=None Gets an integer. The "type" text can be used to customize the error message - received when the argument is not an integer. p is an optional predicate to - test the integer with. If p(i) fails (where i is the integer arg parsed out - of the argument string), the arg will not be accepted. + received when the argument is not an integer. "p" is an optional predicate + to test the integer with. If p(i) fails (where i is the integer arg parsed + out of the argument string), the arg will not be accepted. "index" Basically ("int", "index"), but with a twist. This will take a 1-based @@ -222,7 +224,7 @@ optional, the default value is shown. "letter" Looks for a single letter. (Technically, it looks for any one-element - sequence) + sequence). "haveOp", action="do that" Simply requires that the bot have ops in the channel that the command is @@ -251,7 +253,7 @@ optional, the default value is shown. "seenNick" Checks that the arg is a nick that the bot has seen (NOTE: this is limited - by the size of the history buffer that the bot has) + by the size of the history buffer that the bot has). "channel" Gets a channel to use the command in. If the channel isn't supplied, uses diff --git a/plugins/Anonymous/test.py b/plugins/Anonymous/test.py index e2a9ab05b..728306348 100644 --- a/plugins/Anonymous/test.py +++ b/plugins/Anonymous/test.py @@ -36,7 +36,7 @@ class AnonymousTestCase(ChannelPluginTestCase): try: orig = conf.supybot.plugins.Anonymous.requireRegistration() conf.supybot.plugins.Anonymous.requireRegistration.setValue(False) - m = self.assertNotError('anonymous say %s foo!'%self.channel) + m = self.assertNotError('anonymous say %s foo!' % self.channel) self.failUnless(m.args[1] == 'foo!') finally: conf.supybot.plugins.Anonymous.requireRegistration.setValue(orig) diff --git a/plugins/Config/plugin.py b/plugins/Config/plugin.py index 1ca26757d..0b2dd6fda 100644 --- a/plugins/Config/plugin.py +++ b/plugins/Config/plugin.py @@ -67,8 +67,9 @@ def getCapability(name): while parts: part = parts.pop() if ircutils.isChannel(part): - # If a registry value has a channel in it, it requires a channel.op - # capability, or so we assume. We'll see if we're proven wrong. + # If a registry value has a channel in it, it requires a + # 'channel,op' capability, or so we assume. We'll see if we're + # proven wrong. capability = ircdb.makeChannelCapability(part, 'op') ### Do more later, for specific capabilities/sections. return capability diff --git a/plugins/Plugin/plugin.py b/plugins/Plugin/plugin.py index 2bce5bced..6753125ce 100644 --- a/plugins/Plugin/plugin.py +++ b/plugins/Plugin/plugin.py @@ -38,9 +38,9 @@ import supybot.callbacks as callbacks class Plugin(callbacks.Plugin): """This plugin exists to help users manage their plugins. Use 'plugin - list' to list the loaded plugins; use 'plugin help' to get this sort of - help from other plugins; use the 'plugin' command itself to determine what - plugin a command exists in.""" + list' to list the loaded plugins; use 'plugin help' to get the description + of a plugin; use the 'plugin' command itself to determine what plugin a + command exists in.""" def help(self, irc, msg, args, cb): """ diff --git a/plugins/String/plugin.py b/plugins/String/plugin.py index cbacafd3f..d6b4c0dbe 100644 --- a/plugins/String/plugin.py +++ b/plugins/String/plugin.py @@ -126,7 +126,7 @@ class String(callbacks.Plugin): If is of the form m/regexp/flags, returns the portion of that matches the regexp. If is of the form s/regexp/replacement/flags, returns the result of applying such a - regexp to + regexp to . """ if isinstance(ff, (types.FunctionType, types.MethodType)): f = ff diff --git a/plugins/URL/config.py b/plugins/URL/config.py index d9562e03f..d6268c357 100644 --- a/plugins/URL/config.py +++ b/plugins/URL/config.py @@ -40,10 +40,10 @@ def configure(advanced): URL = conf.registerPlugin('URL') conf.registerChannelValue(URL, 'nonSnarfingRegexp', - registry.Regexp(None, """Determines what URLs are to be snarfed and stored - in the database in the channel; URLs matching the regexp given will not be - snarfed. Give the empty string if you have no URLs that you'd like to - exclude from being snarfed.""")) + registry.Regexp(None, """Determines what URLs are not to be snarfed and + stored in the database for the channel; URLs matching the given regexp will + not be snarfed. Give the empty string if you have no URLs that you'd like + to exclude from being snarfed.""")) # vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79: diff --git a/scripts/supybot b/scripts/supybot index 9b66e0f70..6533f72b8 100644 --- a/scripts/supybot +++ b/scripts/supybot @@ -129,7 +129,7 @@ version = '0.83.4.1+git' if __name__ == '__main__': ### # Options: - # -p (profiling) + # -P (profiling) # -n, --nick (nick) # --startup (commands to run onStart) # --connect (commands to run afterConnect) @@ -177,12 +177,12 @@ if __name__ == '__main__': sys.exit(-1) if len(args) > 1: - parser.error("""Only one configuration option should be specified.""") + parser.error("""Only one configuration file should be specified.""") elif not args: parser.error(utils.str.normalizeWhitespace("""It seems you've given me - no configuration file. If you have a configuration file, be sure to - tell its filename. If you don't have a configuration file, read - docs/GETTING_STARTED and follow its directions.""")) + no configuration file. If you do have a configuration file, be sure to + specify the filename. If you don't have a configuration file, read + docs/GETTING_STARTED and follow the instructions.""")) else: registryFilename = args.pop() try: diff --git a/src/callbacks.py b/src/callbacks.py index 596041571..4c5b268ef 100644 --- a/src/callbacks.py +++ b/src/callbacks.py @@ -251,7 +251,7 @@ class ArgumentError(Error): class Tokenizer(object): # This will be used as a global environment to evaluate strings in. - # Evaluation is, of course, necessary in order to allowed escaped + # Evaluation is, of course, necessary in order to allow escaped # characters to be properly handled. # # These are the characters valid in a token. Everything printable except @@ -332,7 +332,7 @@ class Tokenizer(object): if not args: raise SyntaxError, '"|" with nothing following. I ' \ 'obviously can\'t do a pipe with ' \ - 'nothing before the |.' + 'nothing after the |.' args.append(ends.pop()) while ends: args[-1].append(ends.pop()) diff --git a/src/irclib.py b/src/irclib.py index c87c15768..6085e79df 100644 --- a/src/irclib.py +++ b/src/irclib.py @@ -47,10 +47,10 @@ from utils.structures import queue, smallqueue, RingBuffer ### # The base class for a callback to be registered with an Irc object. Shows # the required interface for callbacks -- name(), -# inFilter(irc, msg), outFilter(irc, msg), and __call__(irc, msg) [used so -# functions can be used as callbacks conceivable, and so if refactoring ever +# inFilter(irc, msg), outFilter(irc, msg), and __call__(irc, msg) [used so as +# to make functions used as callbacks conceivable, and so if refactoring ever # changes the nature of the callbacks from classes to functions, syntactical -# changes elsewhere won't be required. +# changes elsewhere won't be required.] ### class IrcCommandDispatcher(object): @@ -153,7 +153,7 @@ class IrcMsgQueue(object): maintain a priority queue of the messages would be the ideal way to do intelligent queuing. - As it stands, however, we simple keep track of 'high priority' messages, + As it stands, however, we simply keep track of 'high priority' messages, 'low priority' messages, and normal messages, and just make sure to return the 'high priority' ones before the normal ones before the 'low priority' ones. diff --git a/src/ircmsgs.py b/src/ircmsgs.py index 3d5a47e90..5c71cdf99 100644 --- a/src/ircmsgs.py +++ b/src/ircmsgs.py @@ -61,7 +61,7 @@ class IrcMsg(object): any of three major (sets of) arguments. Called with no keyword arguments, it takes a single string that is a raw - IRC message (such as one taken straight from the network. + IRC message (such as one taken straight from the network). Called with keyword arguments, it *requires* a command parameter. Args is optional, but with most commands will be necessary. Prefix is obviously diff --git a/src/ircutils.py b/src/ircutils.py index 815259060..44b06817f 100644 --- a/src/ircutils.py +++ b/src/ircutils.py @@ -28,10 +28,10 @@ ### """ -Provides a great number of useful utility functions IRC. Things to muck around -with hostmasks, set bold or color on strings, IRC-case-insensitive dicts, a -nick class to handle nicks (so comparisons and hashing and whatnot work in an -IRC-case-insensitive fashion), and numerous other things. +Provides a great number of useful utility functions for IRC. Things to muck +around with hostmasks, set bold or color on strings, IRC-case-insensitive +dicts, a nick class to handle nicks (so comparisons and hashing and whatnot +work in an IRC-case-insensitive fashion), and numerous other things. """ import re @@ -461,9 +461,9 @@ def replyTo(msg): return msg.nick def dccIP(ip): - """Returns in IP in the proper for DCC.""" + """Converts an IP string to the DCC integer form.""" assert utils.net.isIP(ip), \ - 'argument must be a string ip in xxx.yyy.zzz.www format.' + 'argument must be a string ip in xxx.xxx.xxx.xxx format.' i = 0 x = 256**3 for quad in ip.split('.'): diff --git a/src/log.py b/src/log.py index 82d5c9866..f91f2fb03 100644 --- a/src/log.py +++ b/src/log.py @@ -47,7 +47,7 @@ import supybot.ircutils as ircutils deadlyExceptions = [KeyboardInterrupt, SystemExit] ### -# This is for testing, of course. Mostly is just disables the firewall code +# This is for testing, of course. Mostly it just disables the firewall code # so exceptions can propagate. ### testing = False diff --git a/src/test.py b/src/test.py index f0e2826df..50dad08a7 100644 --- a/src/test.py +++ b/src/test.py @@ -55,7 +55,7 @@ network = True suites = [] originalCallbacksGetHelp = callbacks.getHelp -lastGetHelp = 'x'*1000 +lastGetHelp = 'x' * 1000 def cachingGetHelp(method, name=None, doc=None): global lastGetHelp lastGetHelp = originalCallbacksGetHelp(method, name, doc) diff --git a/src/utils/gen.py b/src/utils/gen.py index 2f05a859e..6fd138cd3 100644 --- a/src/utils/gen.py +++ b/src/utils/gen.py @@ -72,9 +72,9 @@ def abbrev(strings, d=None): def timeElapsed(elapsed, short=False, leadingZeroes=False, years=True, weeks=True, days=True, hours=True, minutes=True, seconds=True): """Given seconds, returns a string with an English description of - how much time as passed. leadingZeroes determines whether 0 days, 0 hours, - etc. will be printed; the others determine what larger time periods should - be used. + the amount of time passed. leadingZeroes determines whether 0 days, 0 + hours, etc. will be printed; the others determine what larger time periods + should be used. """ ret = [] before = False