Commit Graph

87 Commits

Author SHA1 Message Date
Daniel Folkinshteyn
f310350335 Web: add 'timeout' config for web fetch, default 5 sec.
Otherwise, when a site would take a long time to respond, the thread would hang for quite a while.

also needed to mod src/utils/web.py to take the timeout arg.

Signed-off-by: James McCoy <jamessan@users.sourceforge.net>
2012-10-15 22:10:56 -04:00
Daniel Folkinshteyn
6025f7364c core: force inet_aton argument to string to prevent occasional error on reconnect.
it /should/ always be a string anyway, but sometimes things break with
a TypeError that it is an int instead of the expected string and hangs
up the bot.

Signed-off-by: James McCoy <jamessan@users.sourceforge.net>
2012-10-14 12:21:56 -04:00
James McCoy
cef93a6cfd Use relative imports for all packages under the supybot namespace
Signed-off-by: James McCoy <jamessan@users.sourceforge.net>
2012-09-17 22:12:11 -04:00
James McCoy
82ecf36fcd Update my name/contact information
Signed-off-by: James McCoy <jamessan@users.sourceforge.net>
2012-09-01 10:16:48 -04:00
James McCoy
ca23cbb774 Merge branch 'maint/0.83.4' 2011-12-06 01:18:18 -05:00
James McCoy
360a2036ac Use socket.inet_aton for isIPV4 since Windows doesn't (always?) have inet_pton
Closes: Sf#3430008
Signed-off-by: James McCoy <jamessan@users.sourceforge.net>
2011-12-05 22:48:09 -05: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
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
James Vega
0abe22f5d1 Merge branch 'maint/0.83.4' 2010-09-08 23:50:35 -04:00
James Vega
b0575cec88 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>
2010-09-08 23:31:01 -04:00
James Vega
a6857ce9bf 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)
2010-08-24 19:49:30 -04:00
James Vega
f0852a9e45 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>
(cherry picked from commit 25fc2de643)
2010-08-24 19:14:58 -04:00
Ricky Zhou
6299ef5c22 Account for negative times in timeElapsed.
Signed-off-by: James Vega <jamessan@users.sourceforge.net>
(cherry picked from commit aa2337791a)
2010-08-24 19:02:16 -04:00
James Vega
f03a3f6c85 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>
2010-05-24 15:44:25 -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
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
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
Š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
Ricky Zhou
aa2337791a Account for negative times in timeElapsed.
Signed-off-by: James Vega <jamessan@users.sourceforge.net>
2009-07-20 16:07:51 -04:00
Jeremy Fincher
43129239d6 Added Seen.since, which lets a user see messages which were sent since the last time he parted a channel. 2009-07-01 15:40:58 -05:00
Ricky Zhou
fa3a2dd23b Allow nItems to take longs as well.
Signed-off-by: James Vega <jamessan@users.sourceforge.net>
2009-05-19 00:58:07 -04:00
Jeremy Fincher
757991afc9 Added basic CacheDict with simple test. 2009-04-02 11:28:57 -05:00
James Vega
6b6861f884 Don't specify globals as a kwarg; only in 2.5+
Signed-off-by: James Vega <jamessan@users.sourceforge.net>
2009-03-22 13:47:42 -04:00
James Vega
58d308b54d Fix perlReToReplacer when \ is used in the replacement
Signed-off-by: James Vega <jamessan@users.sourceforge.net>
2009-03-12 17:17:20 -04:00
James Vega
ecd2c63650 Make universalImport support 'from ModuleA import ModuleB'
Signed-off-by: James Vega <jamessan@users.sourceforge.net>
2009-03-11 15:55:08 -04:00
Jeremy Fincher
a86b4694d7 Added utils.python.universalImport to make the previous idiom cleaner. 2009-03-11 14:05:53 -04:00
James Vega
0c42ea111a Fix our RE parsing to handle multiple backslashes before the separator
This also adds support for using brace pairs ({}, [], (), <>) as the
separators for m//.
2009-03-11 13:37:27 -04:00
James Vega
e787c7aa49 Clarify comment about timestamp() override 2009-03-11 13:37:26 -04:00
James Vega
3d5c877f80 Finally fix the XXX we had for httpUrlRe and urlRe 2009-03-11 13:37:26 -04:00
James Vega
828d41e37d Add utils/crypt.py as a Python version-agnostic crypt module 2009-03-11 13:37:26 -04:00
James Vega
880cce5505 src/utils/str.format: Recognize digits before the '.' in %f formatting. 2006-04-06 04:01:11 +00:00
James Vega
a3e4fc5b1d Change the modeline to use softtabstop instead of tabstop. 2006-02-11 15:52:51 +00:00
James Vega
9cb1669b5f src/utils/web: Add another "UNKNOWN_HOST" code to catch. 2005-10-14 12:59:47 +00:00
James Vega
ef3e002db3 src/utils/net: Fix our method of determining whether an IPV6 or IP socket is needed. 2005-08-22 18:52:37 +00:00
Jeremy Fincher
f8156cc9cc Removed TupleSubclass, which wasn't being used. 2005-07-21 18:32:41 +00:00
Jeremy Fincher
1aa73acd8d Removed Acquire, which I won't be using anymore. 2005-07-21 05:04:31 +00:00
Jeremy Fincher
77330d496a Moved an XXX and added a skeleton method. 2005-07-18 04:55:12 +00:00
Jeremy Fincher
fc87901a89 Added some more XXXes for dangerfan. 2005-07-18 04:46:41 +00:00
Jeremy Fincher
27ac845628 Moved some XXXes around, added some methods (so naming them isn't hard) and a new XXX about methods that return file objects. 2005-07-18 04:37:32 +00:00
Jeremy Fincher
91874dba2c Added some XXXes to transaction.py. 2005-07-16 05:09:49 +00:00
Jeremy Fincher
5b8400e158 Removed utils.iter.one, which was dumb, because iterators have a .next() method that does the same thing. 2005-07-08 09:14:45 +00:00
Jeremy Fincher
a88f52bc7f Forgot to change the exception name in one of the spots it was raised in. 2005-07-06 03:59:46 +00:00
Jeremy Fincher
e9c52f6a5f Prefixed some non-public method names with an underscore. 2005-07-06 03:59:16 +00:00
Jeremy Fincher
612a8e1183 Added utils.{transaction,error} 2005-07-05 17:48:00 +00:00
Jeremy Fincher
b369039507 Added utils.iter.one, to grab one value from an iterable. 2005-06-12 04:54:15 +00:00
Jeremy Fincher
b5f1e2a3e7 Added utils.iter.limited, an iterable that limits the number of elements that can be taken from another iterable. 2005-05-30 19:19:11 +00:00
Jeremy Fincher
a1e707caa2 Changed Synchronized to make attributes (and changing the attributes' names) more maintainable. 2005-05-16 18:42:38 +00:00
Jeremy Fincher
79fc5b5994 Fixed a bug in the way Synchronized was implemented. 2005-05-16 00:23:44 +00:00
Jeremy Fincher
cbf154b4ff Fixed Synchronized to allow synchronization of methods not defined in the current class. 2005-05-15 18:26:50 +00:00
Jeremy Fincher
4b0600a91a Added a Synchronized metaclass. 2005-05-15 17:41:07 +00:00