Commit Graph

2697 Commits

Author SHA1 Message Date
James Vega
a9b515fbd2 Use self.error() instead of raise for BooleanRequiredFalseOnWindows.
Closes: Sf#3070285
Signed-off-by: James Vega <jamessan@users.sourceforge.net>
(cherry picked from commit 0fd6a84632)

Signed-off-by: Daniel Folkinshteyn <nanotube@users.sourceforge.net>
2010-10-10 17:40:04 -04:00
James Vega
8baf08b882 Handle changes to fnmatch.translate in Python 2.6
Define utils.python.glob2re based on the Python version being used.
Use glob2re in Todo and Note plugins.

Closes: Sf#3059292
Signed-off-by: James Vega <jamessan@users.sourceforge.net>
(cherry picked from commit b0575cec88)

Signed-off-by: Daniel Folkinshteyn <nanotube@users.sourceforge.net>
2010-10-10 17:38:08 -04:00
Daniel Folkinshteyn
246c73eed2 BadWords: improve help for requireWordBoundaries config.
Make a note that the plugin requires restart or the words set updating,
for changes to this setting to take effect.
2010-09-08 00:11:28 -04:00
Daniel Folkinshteyn
8d80fb9e88 Badwords: add plugin docstring, and fix/standardize some method docstrings. 2010-09-07 20:27:51 -04:00
Daniel Folkinshteyn
3c00d82579 Scheduler: don't immediately execute commands when restoring repeated events. 2010-09-04 01:25:57 -04:00
Daniel Folkinshteyn
0fe7912628 Misc: update version command to get latest version from gribble git.
Note: if this is ever merged into upstream supybot, should change url
to point at supybot gitweb, rather than gribble.
2010-09-02 18:31:42 -04:00
Daniel Folkinshteyn
567e72488d Cherry-pick a bunch of upstream fix commits. 2010-09-02 09:14:22 -04:00
Daniel Folkinshteyn
3a0e19bc22 Scheduler: remove spammy debug output. 2010-09-02 08:54:13 -04:00
Daniel Folkinshteyn
05e8b658e6 Add script to automatically update version with a datestamp upon commit. 2010-08-20 11:08:31 -04:00
Daniel Folkinshteyn
2a40d6eb90 Consolidate the version string to reside in one central place to ease change making. 2010-08-20 10:31:05 -04:00
Daniel Folkinshteyn
29837e94b1 Make plugin loading/reloading case-insensitive.
Since load/reload was the only place where case mattered for plugins, and it tripped up
a lot of new users, this should be a nice bit of usability improvement.
2010-08-11 00:43:05 -04:00
James Vega
808cb2c9f4 Ensure channel-specific reply.whenNotAddressed works.
Signed-off-by: James Vega <jamessan@users.sourceforge.net>
(cherry picked from commit 166f32dcb0)

Signed-off-by: Daniel Folkinshteyn <nanotube@users.sourceforge.net>
2010-08-11 00:13:49 -04:00
Daniel Folkinshteyn
e4498664bb Fix error handling for subprocesses. 2010-08-08 00:39:51 -04:00
Daniel Folkinshteyn
27be9ceb74 commands.process: return immediately when terminating process, without having to deal with the queue.
otherwise, we have to block for $smalldelay between putting and getting the item, since queue putting is not instantaneous
and sometimes we would get 'nothing returned' instead of the timeout message.
2010-08-05 14:48:12 -04:00
Daniel Folkinshteyn
89cbc7efdf Some improvements to the commands.process function - better process naming and informational output. 2010-08-05 13:45:02 -04:00
Daniel Folkinshteyn
0c300162d8 Create a commands.process function which runs a function inside a separate process.
This is the only way to limit the execution time of a possibly long-running python statement.
Use this on String.re, due to the possibility of pathologically long re matching in python.
This allows us to remove the 'trusted-only' restriction on string.re.
In the future, this should probably be used in other places that take user-supplied regexps,
such as 'misc last --regexp', for example, as well as other potentially long-running tasks
that can block the bot.
2010-08-05 01:20:46 -04:00
Daniel Folkinshteyn
a9e2fc7bed Socket driver: implement ssl connection support. 2010-07-11 02:29:02 -04:00
James Vega
dbde5fc250 Elide ignored replies from nested command output.
Signed-off-by: James Vega <jamessan@users.sourceforge.net>
(cherry picked from commit c10d964604)

Signed-off-by: Daniel Folkinshteyn <nanotube@users.sourceforge.net>
2010-06-25 00:41:47 -04:00
James Vega
929859b246 Twisted: Send all available ircmsgs and reduce delay between checks
All ircmsgs that takeMsg will return should be processed each time
checkIrcForMsgs is called since there may be multiple available in the
fastqueue.

Reduced the time between calls of checkIrcForMsgs so the delay between
normally queued ircmsgs stays close to the configured throttleTime.

Closes: Sf#3018148
(cherry picked from commit adc5d62bbf)

Signed-off-by: Daniel Folkinshteyn <nanotube@users.sourceforge.net>
2010-06-19 22:19:08 -04:00
James Vega
108f7f2f86 Socket: Ensure driver is flagged as disconnected after a socket error.
Users were occasionally hitting a situation where the socket had errored,
causing a reconnect, but the socket wasn't closed nor the driver marked as
disconnected.  This resulted in run() continuing to try and use the driver,
which would cause another error, schedule another reconnect, log an error, ad
infinitum.

Closes: Sf#2965530

Signed-off-by: James Vega <jamessan@users.sourceforge.net>
(cherry picked from commit a278d17f2b)

Signed-off-by: Daniel Folkinshteyn <nanotube@users.sourceforge.net>
2010-06-03 10:44:25 -04:00
James Vega
bc8457dc90 utils/web.py: Only try catching socket.sslerror if built with SSL support
Closes: Sf#2998820

Signed-off-by: James Vega <jamessan@users.sourceforge.net>
(cherry picked from commit f03a3f6c85)

Signed-off-by: Daniel Folkinshteyn <nanotube@users.sourceforge.net>
2010-06-03 10:43:54 -04:00
Jeremy Fincher
df2c6c2650 Updates and tweaks to some ircutils functions.
(cherry picked from commit 6135a88741)

Signed-off-by: Daniel Folkinshteyn <nanotube@users.sourceforge.net>
2010-06-03 10:42:58 -04:00
Štěpán Němec
51cabeea33 Topic plugin: Add persistence support.
Topics now persist between restarts.

Rationale: Useful when reloading/restarting; previously the topics would
be just forgotten. Don't use database, as that would be an unnecessary
overkill and in any case not needed.

(Also, remove the unused `re' module import.)

Signed-off-by: James Vega <jamessan@users.sourceforge.net>
(cherry picked from commit 6520d1f282)

Signed-off-by: Daniel Folkinshteyn <nanotube@users.sourceforge.net>
2010-05-12 13:19:54 -04:00
James Vega
5ad620b5fd Make registry.Regexp.error mimic registry.Value.error
Regexp.error can't directly call Value.error because it's providing extra
information, so it needs to build the InvalidRegistryValue exception itself
and raise it.

Closes: Sf#2985241

Signed-off-by: James Vega <jamessan@users.sourceforge.net>
(cherry picked from commit ef8bd817e8)

Signed-off-by: Daniel Folkinshteyn <nanotube@users.sourceforge.net>
2010-04-19 01:00:02 -04:00
Daniel Folkinshteyn
35fee237da Undo mtughan's bugfix from 7f9a113060, so i can merge jamessan's fix ef8bd817e8 2010-04-19 00:53:40 -04:00
Daniel Folkinshteyn
b5058cc5c2 update Karma plugin and test code to use sqlite3.
This involved also updating src/conf.py to look for sqlite3 and add it to supybot.conf.databases list,
since karma uses the plugins.DB() constructor for its database, which checks the available databases list.
2010-04-18 02:10:29 -04:00
Daniel Folkinshteyn
7f9a113060 commit mtughan's bugfix for this bug:
https://sourceforge.net/tracker/?func=detail&aid=2985241&group_id=58965&atid=489447
2010-04-11 00:42:55 -04:00
Daniel Folkinshteyn
5d9273cd5a add damerau-levenshtein distance to supybot.utils.seq
use it in factoids invalid command to match possible typos
write tests for same.
2010-04-07 12:33:28 -04:00
Daniel Folkinshteyn
3ea6e58365 add standardsubstitute vars 'utc' and 'gmt' which output current time in UTC. 2010-03-08 17:24:00 -05:00
Daniel Folkinshteyn
13c244c9a7 fix some time display issues in standardsubstitute:
first, use explicit time.strftime() instead of time.ctime, since ctime() leaves an extra space between month and date, if date is
single-digit.

second, use stftime('%Z') for timezone, old code was a bug which always displayed the daylight saving timezone name, even when it wasn't
in effect. time.daylight is not a dst flag, it is a flag for whether a dst timezone is /defined/, not if it is in effect.
2010-03-08 16:39:45 -05:00
James Vega
4a9596608a Include hostmasks in JOIN, PART, QUIT logs.
Signed-off-by: James Vega <jamessan@users.sourceforge.net>
2010-02-28 21:17:35 -05:00
James Vega
0540513387 Decode/encode as 'string_escape' when (de)serializing the registry.
Signed-off-by: James Vega <jamessan@users.sourceforge.net>
2010-01-30 23:03:35 -05:00
James Vega
288d7c6e02 Update plugins to ignore all non-ACTION CTCP messages.
Also update commands.urlSnarfer to do the same, which allows us to revert
"Don't bother snarfing URLs from non-Action CTCP messages."

This reverts commit 3282e3407e.

Signed-off-by: James Vega <jamessan@users.sourceforge.net>
2010-01-28 08:14:44 -05:00
Jeremy Fincher
5f9d2bc4ce We had an issue with a command flooder, so we've tightened command flood detection to detect things on a per-host basis, rather than a per-user@host basis. 2009-12-28 12:26:33 -06:00
Jeremy Fincher
b774268498 Added network to debug "Incoming message" log. 2009-12-28 12:17:27 -06:00
James Vega
07e283f450 Default to strict RFC compliance.
It's better to force people to use an RFC nick and change it after they
connect than to let non-RFC nicks get used and not be able to connect to the
network.

Signed-off-by: James Vega <jamessan@users.sourceforge.net>
2009-11-18 20:02:53 -05:00
James Vega
8a98653d3b Allow Banmask.makeBanmask to work when dynamic.channel is None.
This gives back the ability to generate a banmask based on the global banmask
settings instead of per-channel settings.

Signed-off-by: James Vega <jamessan@users.sourceforge.net>
2009-11-01 10:26:08 -05:00
James Vega
56ba12aa4b Add support for UltimateIRCd's ! (protected) user mode.
Signed-off-by: James Vega <jamessan@users.sourceforge.net>
2009-10-23 19:20:02 -04:00
James Vega
035a9f2459 Add registry.TemplatedString for config variables which use string.Template 2009-10-15 22:17:36 -04:00
James Vega
25fc2de643 utils.web: Provide access to the raw httpUrlRe/urlRe strings
Using the compiled regexps for a PluginRegexp method's __doc__ doesn't work.

Closes Sourceforge #2879862

Signed-off-by: James Vega <jamessan@users.sourceforge.net>
2009-10-15 22:16:38 -04:00
James Vega
f7cedae9ad Update ircutils.standardSubstitute to use string.Template
In the process, deprecate utils.str.perlVariableSubstitute.

Since string.Template doesn't support callable values though, we also
sub-class IrcDict and override __getitem__ to call the value if it is
callable.

Signed-off-by: James Vega <jamessan@users.sourceforge.net>
2009-10-15 22:16:29 -04:00
James Vega
c5896ff6cb utils.web: Import urllib's urlencode into our namespace.
Signed-off-by: James Vega <jamessan@users.sourceforge.net>
2009-09-29 19:54:07 -04:00
James Vega
56fbbe9f36 commands.py: Explain the odd userHostmask check in getOtherUser
Signed-off-by: James Vega <jamessan@users.sourceforge.net>
2009-09-23 18:29:49 -04:00
James Vega
de79e679f4 Add a data kwarg to getUrl(Fd) a la urllib2.Request.
This allows plugins to easily make POST requests using our getUrl(Fd)
functions.

Signed-off-by: James Vega <jamessan@users.sourceforge.net>
2009-09-16 01:17:33 -04:00
James Vega
e9a896c736 Clarify databases.types.cdb.maximumModifications' help and use a proper type.
The code expects a float between 0 and 1 inclusive but was simply using
registry.Float.  registry.Probability matches the behavior we want.

Signed-off-by: James Vega <jamessan@users.sourceforge.net>
2009-09-11 18:09:38 -04:00
James Vega
459bc616b1 Reply with an error when getBanmask doesn't have a valid channel.
Signed-off-by: James Vega <jamessan@users.sourceforge.net>
2009-09-02 07:40:33 -04:00
James Vega
260570bd4f Ensure getBanmask has a channel variable as per makeBanmask's requirement
Signed-off-by: James Vega <jamessan@users.sourceforge.net>
2009-09-01 23:29:42 -04:00
James Vega
eff20402ac Change canonize => normalize
Signed-off-by: James Vega <jamessan@users.sourceforge.net>
2009-08-27 16:41:34 -04:00
Štěpán Němec
a66034f852 Fix some typos/wordings.
Signed-off-by: James Vega <jamessan@users.sourceforge.net>
2009-08-26 16:34:12 -04:00
Štěpán Němec
53cac5b078 callbacks.py: Remove duplicated getRealIrc() definition
NestedCommandsIrcProxy inherits the method from ReplyIrcProxy.
(Also fix some typos.)

Signed-off-by: James Vega <jamessan@users.sourceforge.net>
2009-08-20 11:23:12 -04:00