Commit Graph

192 Commits

Author SHA1 Message Date
James McCoy
a42ab2e2d4 ircutils.FormatParser: Make getInt only get integers that are valid colors
If a colored message were wrapped just right (e.g., a colored number ending
the chunk), FormatParser would gobble up the color format code and the number
in the message, causing a KeyError when trying to look up the color in
mircColors.

Signed-off-by: James McCoy <jamessan@users.sourceforge.net>
2012-07-02 21:11:50 -04:00
Valentin Lorentz
c39ad2f379 Fix KeyError when using colors in a message containing numbers. 2012-06-16 11:27:31 +00:00
James McCoy
8b73f78b3e Merge branch 'maint/0.83.4'
Conflicts:
	plugins/Misc/plugin.py
	src/ircutils.py

Signed-off-by: James McCoy <jamessan@users.sourceforge.net>
2011-11-13 15:26:19 -05:00
Daniel Folkinshteyn
8f7c4bdf7f Fix banmask creation. Thanks Progval for the patch!
fixes https://sourceforge.net/tracker/?func=detail&aid=3088559&group_id=58965&atid=489447

incorporating patch https://sourceforge.net/tracker/?func=detail&aid=3163843&group_id=58965&atid=489449

Signed-off-by: James McCoy <jamessan@users.sourceforge.net>
2011-10-22 14:25:26 -04:00
James Vega
543e78828b Add utils.net.isIPV4, with utils.net.isIP checking v4 or v6
Signed-off-by: James Vega <jamessan@users.sourceforge.net>
2011-06-06 21:44:15 -04:00
Jeremy Fincher
6135a88741 Updates and tweaks to some ircutils functions. 2010-05-18 12:48:36 -05:00
Daniel Folkinshteyn
51eac7da5b add standardsubstitute vars 'utc' and 'gmt' which output current time in UTC.
Signed-off-by: James Vega <jamessan@users.sourceforge.net>
2010-04-11 17:01:11 -04:00
Daniel Folkinshteyn
2c9f325cf4 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.

Signed-off-by: James Vega <jamessan@users.sourceforge.net>
2010-04-11 17:00:50 -04: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
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
Š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
James Vega
bb759259b8 Remove useless comments and fix a SyntaxError
Signed-off-by: James Vega <jamessan@users.sourceforge.net>
2009-04-03 10:04:39 -04:00
Jeremy Fincher
dd4bc64e32 Changed a few caches to use CacheDict to ensure no without-bound growth on caches. 2009-04-02 11:45:00 -05:00
James Vega
07be8cd2c0 src/ircutils.py: A nasty hack around mIRC's broken color code rules. Must specify a foreground color if a background color is being specified, so we'll default it to white. 2006-05-25 19:52:16 +00:00
James Vega
a3e4fc5b1d Change the modeline to use softtabstop instead of tabstop. 2006-02-11 15:52:51 +00:00
Jeremy Fincher
cede4a4a97 Fixed bug in ircutils.isNick, which allowed nicks to start with dashes. 2005-08-02 02:47:42 +00:00
James Vega
9971e991fe Fix the modelines. 2005-03-23 20:07:45 +00:00
James Vega
aefcd594df Move structures to utils/ 2005-03-12 18:01:47 +00:00
James Vega
0fde2393e6 Update usage of utils.iter functions. 2005-01-31 15:22:48 +00:00
Jeremy Fincher
5fd6bbb52d Completely restructured our utils modules.
Tons of changes.  Here's the summary of things that matter most:

* There is no more supybot.fix.
* There is no more supybot.webutils; now there is supybot.utils.web.
  * It's no longer webutils.WebError, but just utils.web.Error.
* You shouldn't import itertools, ideally, but instead import utils.iter.
* No more using imap/ifilter in commands unless absolutely necessary.  It's
  premature optimization and annoying.
* utils.str.format isn't quite ready yet, but will be soon.  That'll be the
  next big thing to fix in our code.
2005-01-27 06:59:08 +00:00
Jeremy Fincher
5019d10a1b Updated license years. 2005-01-19 13:33:05 +00:00
Jeremy Fincher
8ca625d339 Initial import. 2005-01-19 13:14:38 +00:00
James Vega
dbfec8afb9 Add supybot module 2007-04-22 20:10:26 +00:00
Jeremy Fincher
6d9cc6855d Updated some docstrings. 2004-12-20 19:19:29 +00:00
Jeremy Fincher
aa83ab2420 Removed an XXX. 2004-12-16 09:02:55 +00:00
Jeremy Fincher
eac5d2f9f8 Added a couple asserts. 2004-12-06 22:42:34 +00:00
Jeremy Fincher
e688faf16e Moved standardSubstitute to ircutils. 2004-10-27 01:37:19 +00:00
Jeremy Fincher
39ab3459de Removed a dumb valueerror. 2004-10-26 19:09:43 +00:00
James Vega
cbd5abbab7 A bunch more %r -> %s conversions as well as wrap updates, new policy for
Channel.voice and some bug fixes for Debian
2004-10-25 22:59:03 +00:00
Jeremy Fincher
a0c0d833e3 Let's make channellen parameterizable as well. 2004-10-15 11:20:51 +00:00
Jeremy Fincher
26771923f6 Allow None in IrcDict and InsensitivePreservingDicts. 2004-10-01 21:25:01 +00:00
James Vega
50973a10fb Remove #! lines. 2004-09-20 03:01:50 +00:00
Jeremy Fincher
1ba0fccd34 Slight tweak to make a test in test_Channel.py pass. 2004-09-16 14:29:13 +00:00
Jeremy Fincher
e44f7ab50c Fixed bug #1019387. Again. 2004-09-14 17:12:21 +00:00
Jeremy Fincher
934363db10 Added some __repr__ action. 2004-09-14 15:38:49 +00:00
Jeremy Fincher
39f427d4be Even when not strict, spaces can't be in nicks. 2004-09-12 05:48:36 +00:00
Jeremy Fincher
db7940089b Added FloodQueue. 2004-09-08 22:49:08 +00:00
Jeremy Fincher
fbb348b6e7 Copyright updates. Again, more is left to be done, but this is my part. 2004-08-23 13:14:06 +00:00
Jeremy Fincher
966129c9a3 A docstring doesn't hurt much. 2004-08-21 08:02:52 +00:00
Jeremy Fincher
d36459ab0b More spelling/capitalization normalization. 2004-08-19 13:33:34 +00:00
Jeremy Fincher
6bd8d43c28 PyChecker updates. 2004-08-10 22:09:23 +00:00
Jeremy Fincher
127e9f3ccf Fixed a bug in stripFormatting. 2004-08-08 02:07:11 +00:00
Jeremy Fincher
823bfb040f Added utils.AtomicFile and converted our uses of 'w' to it. This rocks. 2004-07-31 10:21:07 +00:00
James Vega
115a3a88ec move isCtcp to ircmsgs and fix up a couple things with Infobot 2004-07-31 03:45:25 +00:00
Jeremy Fincher
a3e04ea9e8 Handled some XXXs. 2004-07-31 00:46:26 +00:00
Jeremy Fincher
a8a95c2ecc Fixed the one-channel bug. 2004-07-30 22:35:51 +00:00
Jeremy Fincher
61793a489c Added the new buttkicking enable/disable. 2004-07-29 09:46:22 +00:00
Jeremy Fincher
bfa2382aae Slight doc/style updates. 2004-07-28 16:42:39 +00:00
Jeremy Fincher
f9c61271ea w00, less path mungingEXCLAIMEXCLAIM 2004-07-24 05:18:26 +00:00
Jeremy Fincher
a4386a6798 Updated to make mircColors an IrcDict, and clean up the limplementation of mircColor function. 2004-07-22 22:30:24 +00:00
Jeremy Fincher
c064aa1155 Let's make sure to zfill those digits before we mircColor. 2004-07-22 20:57:46 +00:00
Jeremy Fincher
9e6a3ed094 Fixed bug #960696. 2004-07-22 16:16:01 +00:00
James Vega
315810d08e yay! no more stray whitespace 2004-07-21 19:36:35 +00:00
Jeremy Fincher
2377a4a83c Automatically convert non-strings to strings with safeArgument. 2004-07-19 22:33:58 +00:00
Jeremy Fincher
581a489177 Changed the non-strictRfc implementation of isNick not to allow full hostmasks. 2004-06-19 03:04:02 +00:00
Jeremy Fincher
b4f977e2dd Fixed the wacky addressed problems. 2004-05-06 15:48:09 +00:00
Jeremy Fincher
b7fb78abed Slight optimization, finally figured out how to automatically intern all IrcStrings. 2004-04-27 11:06:26 +00:00
Jeremy Fincher
99adf8511f Uh, someone forgot to make the remainder of the changes necessary for the unColor -> stripColor conversion... 2004-04-15 23:41:24 +00:00
James Vega
e87c31aea4 ircutils.strip{Bold,Reverse,Underline,Formatting} 2004-04-15 21:15:57 +00:00
Jeremy Fincher
132adeff7d Updated. 2004-04-13 05:18:17 +00:00
James Vega
0027117e8c Fix some coloring/formatting bugs we had 2004-04-13 01:01:17 +00:00
Jeremy Fincher
f8b83f69f2 Slight optimization, not that it matters, but it makes the code easier to read, too. 2004-04-09 15:30:09 +00:00
James Vega
b2153c83fb unColor is now working. Added a colorstrip outfilter to Filter to close RFE
#863599
2004-04-09 03:59:12 +00:00
Jeremy Fincher
de512b24de Guarded asserts with strictRfc. 2004-02-24 11:21:12 +00:00
Jeremy Fincher
ff370e29cf Who knows why I wrote that without a for loop before? 2004-02-16 00:54:05 +00:00
Jeremy Fincher
487fb3cc2f Made separateModes int the argument if it can. 2004-02-16 00:51:29 +00:00
Jeremy Fincher
74300bb148 Man, I must've been really sleepy when I 'fixed' that code. 2004-02-13 08:58:29 +00:00
Jeremy Fincher
5d3a3437db Fixed G-LiTe's bug with -l. 2004-02-11 06:57:35 +00:00
Jeremy Fincher
c04d3632cc strictRfc added, off by default. 2004-02-11 05:57:34 +00:00
Jeremy Fincher
d2d5f880ed Trying something out for fixing the Jawoota unicode bug. 2004-02-10 06:19:16 +00:00
Jeremy Fincher
6771c24ca6 Added InsensitivePreservingDict and made IrcDict a subclass of it. 2004-02-05 07:14:35 +00:00
Jeremy Fincher
c62702cfc3 Foo! 2004-01-23 13:08:42 +00:00
Jeremy Fincher
fd132f20ad Added setdefault and get to IrcDict. 2004-01-19 22:29:55 +00:00
Jeremy Fincher
29426e2f1d Moved isIP* to utils from ircutils. 2004-01-16 17:33:51 +00:00
Jeremy Fincher
ed7748492f Fix for isIPV6 on platforms that don't support IPV6. 2004-01-07 22:48:01 +00:00
Jeremy Fincher
a0d2a9da2a Fixed bug #863808; added isIPV6. 2004-01-02 20:50:43 +00:00
Jeremy Fincher
a63d175498 Added memoization of hostmaskPatternEqual. 2003-12-16 20:36:43 +00:00
Jeremy Fincher
c1f88120f0 Added an assert. 2003-12-16 18:14:48 +00:00
Jeremy Fincher
3f6d347e2b Added isCtcp. 2003-12-10 18:49:45 +00:00
Jeremy Fincher
b91a1b8941 Oops, shouldn't have committed, a stray underscore got here. 2003-12-06 14:18:10 +00:00
Jeremy Fincher
12fff1941e Added a comment. 2003-12-06 14:16:18 +00:00
Jeremy Fincher
6925ecf760 New hostmaskPatternEqual that's a bit more correct and perhaps slightly faster. 2003-12-03 23:13:07 +00:00
Jeremy Fincher
c8de1e8155 Made the string of flags that require an argument an optional argument so you can parse the flags for some other purpose. 2003-12-01 21:59:01 +00:00
Jeremy Fincher
48166f4895 Huge update to the logging infrastructure. 2003-11-26 18:21:12 +00:00
Jeremy Fincher
a4284e7924 Added __revision__ strings. 2003-11-25 08:38:19 +00:00
Jeremy Fincher
eb6e112f70 Changed some maps/filters to imaps/ifilters for efficiency reasons (I was bored, basically). 2003-11-15 04:37:04 +00:00
Jeremy Fincher
6004181695 Fixed bug in banmask when the host doesn't have a dot in it (rare, but possible). 2003-11-13 19:00:35 +00:00
Jeremy Fincher
e0cfe722c7 Added an assert for easier debugging. 2003-11-11 14:06:19 +00:00
Jeremy Fincher
c746f9459b Optimization to hostmaskPatternEqual. 2003-11-05 22:21:43 +00:00
Jeremy Fincher
3f8c149047 Fixed major bugz0rs with IrcSet and IrcDict. 2003-11-04 05:50:19 +00:00
Jeremy Fincher
ff57e4b67b Made proper super calls. 2003-11-03 23:25:04 +00:00
Daniel Berlin
b0fd3f547c Move ircutils.standardsubttext to plugins.standardSubstitute, make it do case insensitive replacement 2003-10-30 05:14:14 +00:00
Daniel Berlin
70be390875 Add standard substitution function 2003-10-29 20:08:34 +00:00
Jeremy Fincher
6077e2896b Cosmetic change to a variable name. 2003-10-25 18:28:36 +00:00
Jeremy Fincher
1168251809 Removed shrinkList and privmsgPayload. 2003-10-23 05:13:51 +00:00
Jeremy Fincher
9c2a8121ec Fixed bug in isNick. 2003-10-22 01:40:27 +00:00
Jeremy Fincher
155aeebe42 Added dccIP and unDccIP. 2003-10-09 16:12:53 +00:00
Jeremy Fincher
8eed3f0982 Stupid __eq__ not being used in __ne__... 2003-10-09 05:46:35 +00:00
Jeremy Fincher
ce0002f454 Made IrcString more efficient/better, added a test for it. 2003-10-09 05:34:44 +00:00
Jeremy Fincher
970c819e79 Changed fix.py to munge __builtins__ rather than requiring a "from fix import *" statement. 2003-10-05 12:47:19 +00:00