Commit Graph

10880 Commits

Author SHA1 Message Date
Daniel Folkinshteyn
e4498664bb Fix error handling for subprocesses. 2010-08-08 00:39:51 -04:00
Daniel Folkinshteyn
89fd19ed7d Status.processes: add output of currently active processes. 2010-08-06 14:48:21 -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
e779b70609 Merge branch 'multiprocess' 2010-08-05 14:01:23 -04:00
Daniel Folkinshteyn
f55606cfb4 Status: add 'processes' command, the multiprocessing equivalent of the threads command. 2010-08-05 13:54:54 -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
1b84e208ca Format.replace: replacement text is now allowed to be the empty string. 2010-08-05 01:27:38 -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
9398025088 MoobotFactoids: add check_same_thread=False to the sqlite3 connect calls, so it doesn't complain. (thanks malex!)
also fix up the code a bit so it doesn't fail the tests, and doesn't require presence of plain sqlite.
2010-08-02 17:51:17 -04:00
James Vega
166f32dcb0 Ensure channel-specific reply.whenNotAddressed works.
Signed-off-by: James Vega <jamessan@users.sourceforge.net>
2010-07-26 19:48:37 -04:00
Daniel Folkinshteyn
3a181b6dd2 Google: fix encoding bug in lucky --snippet; need to pass encoded string to utils.web.htmlToText 2010-07-26 09:22:07 -04:00
Daniel Folkinshteyn
d469108054 Topic: fix bug in invalid number error output.
Previously, when giving an invalid positive number, error would reference number-1 as being invalid.
2010-07-23 16:50:25 -04:00
Daniel Folkinshteyn
4aa876255c Filter: catch invalid input for unbinary command. 2010-07-21 12:57:18 -04:00
Daniel Folkinshteyn
920c37c314 Unix: add call command, giving owner ability to call any system command. 2010-07-21 12:48:46 -04:00
Daniel Folkinshteyn
76f109ce0d Google: in lucky --snippet, properly convert html to text, using utils.web.htmlToText. 2010-07-14 19:08:13 -04:00
Daniel Folkinshteyn
6905d22c2c Google: add --snippet option to lucky command, which shows the text snippet for the page. 2010-07-14 15:56:48 -04:00
brian c
edc4d8644e Unix: various enhancements to the ping command:
Fixed bug in 100% packet loss response.
Errors from ping are now sent to irc.error().
Added packet count, interval, ttl, and wait options.
Added additional test cases.

Also, Enabled threading for Unix plugin, and
for wtf, spell, and ping commands.

Signed-off-by: Daniel Folkinshteyn <nanotube@users.sourceforge.net>
2010-07-13 11:52:51 -04:00
James Vega
3a84faeb18 Include String plugin for Utilities' tests.
Signed-off-by: James Vega <jamessan@users.sourceforge.net>
(cherry picked from commit 3090cffe2c)

Signed-off-by: Daniel Folkinshteyn <nanotube@users.sourceforge.net>
2010-07-11 23:06:03 -04:00
James Vega
6e33df49ab ShrinkUrl: Add serviceRotation config.
When configured, the outFilter and shrinkSnarfer use cycle through
serviceRotation's list of services.  Otherwise, the default service is used.

Closes: deb#539858

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

Signed-off-by: Daniel Folkinshteyn <nanotube@users.sourceforge.net>
2010-07-11 23:05:39 -04:00
James Vega
3090cffe2c Include String plugin for Utilities' tests.
Signed-off-by: James Vega <jamessan@users.sourceforge.net>
2010-07-11 11:04:33 -04:00
James Vega
0bfa0d153c ShrinkUrl: Add serviceRotation config.
When configured, the outFilter and shrinkSnarfer use cycle through
serviceRotation's list of services.  Otherwise, the default service is used.

Closes: deb#539858

Signed-off-by: James Vega <jamessan@users.sourceforge.net>
2010-07-11 10:47:37 -04:00
Daniel Folkinshteyn
a9e2fc7bed Socket driver: implement ssl connection support. 2010-07-11 02:29:02 -04:00
oevna@users.sourceforge.net
6df6d477f1 Unix: fixed uncaught OSError exception raised when executing ping fails.
Signed-off-by: Daniel Folkinshteyn <nanotube@users.sourceforge.net>
2010-07-09 12:22:32 -04:00
Daniel Folkinshteyn
e178d04522 Unix: fix test for the ping command, call unix ping instead of the default misc ping. 2010-07-08 23:29:01 -04:00
oevna@users.sourceforge.net
a8e91a58a0 Added ping command to Unix plugin
Signed-off-by: Daniel Folkinshteyn <nanotube@users.sourceforge.net>
2010-07-08 23:19:57 -04:00
Daniel Folkinshteyn
67a41f6626 Filter: add unbinary command, as counterpart to binary command. 2010-07-01 15:44:53 -04:00
James Vega
0781ff339e Services: Don't filter outgoing JOIN messages on disabled networks
Signed-off-by: James Vega <jamessan@users.sourceforge.net>
(cherry picked from commit acffde68ab)

Signed-off-by: Daniel Folkinshteyn <nanotube@users.sourceforge.net>
2010-06-28 23:12:35 -04:00
James Vega
acffde68ab Services: Don't filter outgoing JOIN messages on disabled networks
Signed-off-by: James Vega <jamessan@users.sourceforge.net>
2010-06-27 19:48:36 -04:00
James Vega
23cca935cb Use conf.registerGlobalValue to ensure generated values are properly setup.
Signed-off-by: James Vega <jamessan@users.sourceforge.net>
(cherry picked from commit 0c62204809)

Signed-off-by: Daniel Folkinshteyn <nanotube@users.sourceforge.net>
2010-06-25 00:42: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
0c62204809 Use conf.registerGlobalValue to ensure generated values are properly setup.
Signed-off-by: James Vega <jamessan@users.sourceforge.net>
2010-06-24 00:37:40 -04:00
James Vega
c10d964604 Elide ignored replies from nested command output.
Signed-off-by: James Vega <jamessan@users.sourceforge.net>
2010-06-24 00:33:04 -04:00
James Vega
16dbd8917a Services: Properly register the NickServ.password group and child values.
Closes: Sf#3019174

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

Signed-off-by: Daniel Folkinshteyn <nanotube@users.sourceforge.net>
2010-06-22 00:13:13 -04:00
James Vega
d78f7b6ac5 Services: Properly register the NickServ.password group and child values.
Closes: Sf#3019174

Signed-off-by: James Vega <jamessan@users.sourceforge.net>
2010-06-21 19:35:35 -04:00
James Vega
be39fcdbc6 supybot: Remove extraneous sys.stdin.close()
Signed-off-by: James Vega <jamessan@users.sourceforge.net>
(cherry picked from commit 0e22e218f0)

Signed-off-by: Daniel Folkinshteyn <nanotube@users.sourceforge.net>
2010-06-21 14:53:28 -04:00
James Vega
9b9d009c43 Services: Fix conflict with callbacks.Commands.isDisabled
Signed-off-by: James Vega <jamessan@users.sourceforge.net>
(cherry picked from commit f926804f40)

Signed-off-by: Daniel Folkinshteyn <nanotube@users.sourceforge.net>
2010-06-21 14:53:08 -04:00
James Vega
d21fc27e0c Services: Disable most of the plugin on networks in the disabled list.
Notify the user when trying to use the commands on a disabled network, ignore
noJoinsUntilIdentified, and don't try communicating with services.

Closes: Sf#3018464

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

Signed-off-by: Daniel Folkinshteyn <nanotube@users.sourceforge.net>
2010-06-21 14:52:42 -04:00
James Vega
0e22e218f0 supybot: Remove extraneous sys.stdin.close()
Signed-off-by: James Vega <jamessan@users.sourceforge.net>
2010-06-20 09:40:57 -04:00
James Vega
f926804f40 Services: Fix conflict with callbacks.Commands.isDisabled
Signed-off-by: James Vega <jamessan@users.sourceforge.net>
2010-06-19 22:38:27 -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
Daniel Folkinshteyn
432228c736 fix google calc to work when doing a currency conversion.
made the calcre more generic, so it finds stuff on both math and currency.
nothing a little exploration of google html page source couldn't solve.

Signed-off-by: James Vega <jamessan@users.sourceforge.net>
2010-06-19 18:01:38 -04:00
Daniel Folkinshteyn
8daebd1240 make Misc.apropos return plugin name even if command is in only one plugin.
Signed-off-by: James Vega <jamessan@users.sourceforge.net>
2010-06-19 17:20:20 -04:00
James Vega
9e73f4482c Services: Disable most of the plugin on networks in the disabled list.
Notify the user when trying to use the commands on a disabled network, ignore
noJoinsUntilIdentified, and don't try communicating with services.

Closes: Sf#3018464

Signed-off-by: James Vega <jamessan@users.sourceforge.net>
2010-06-19 16:59:13 -04:00
James Vega
adc5d62bbf 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
2010-06-18 20:33:43 -04:00
Daniel Folkinshteyn
1ce52f01f4 ChannelLogger: include in logs the reasons for parts and quits 2010-06-15 23:53:15 -04:00
Daniel Folkinshteyn
a91bc318dc Channel: nicks: add --count argument, which outputs only the count of nicks in channel.
also add tests for the nick command.
2010-06-13 02:36:18 -04:00
Daniel Folkinshteyn
80491fddb1 Conditional: allow empty string arguments in string-comparison functions 2010-06-03 17:03:39 -04:00
Daniel Folkinshteyn
5f2d2a9c5e Utilities: add countargs function, returns number of arguments supplied.
also add tests for it.
2010-06-03 16:08:25 -04:00
Daniel Folkinshteyn
52b36555f4 Utilities: add 'sample' command, a basic interface to random.sample()
Also add tests for it.
2010-06-03 13:06:28 -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