Commit graph

110 commits

Author SHA1 Message Date
jesopo
4796d4264c Print lines not [lines] in src/IRCBot.py 2018-10-17 17:36:01 +01:00
jesopo
c48574a3d6 "Cannot" -> "can't" in IRCServer encoding fallback 2018-10-17 17:04:56 +01:00
jesopo
a4bfae9557 TRACE log when we have to use fallback encoding 2018-10-17 16:54:33 +01:00
jesopo
6c6d593e6d Only log exceptions when they're not unsafe 2018-10-16 14:53:37 +01:00
jesopo
ba3cd00c78 Add utils.EventError, utilise it for stderr in commands.py/coins.py 2018-10-16 14:47:01 +01:00
jesopo
743b3bc754 event["args"] is an array already, args_split does not exist. Also send raw
events from src/IRCServer.py as call_unsafe to make errors like that more
apparent.
2018-10-15 14:29:16 +01:00
jesopo
40ffb6ce0e Typo in src/IRCServer.py, 'defau;t' -> 'default' 2018-10-14 14:31:30 +01:00
jesopo
0ed0b235e9 Work directly from users in modules/coins.py.interest(), so as to not give
double-interest to two "users" online at the same time sharing the same identity
2018-10-14 14:30:19 +01:00
jesopo
43d026cc9d Typo in src/Timers.py, 'conteext' -> 'context' 2018-10-13 09:16:53 +01:00
jesopo
5e3399f73e Actually, don't give contexts to timers that aren't contextual. (e.g. pesistent
timers)
2018-10-13 09:10:26 +01:00
jesopo
33921a8912 Timers._add takes a "context" param 2018-10-13 09:09:51 +01:00
jesopo
64cc1bf16c a Timer object can have a context yet not be a contextual timer 2018-10-13 09:09:24 +01:00
jesopo
561d686643 Correctly remove contextual timers from src/Timers.py 2018-10-13 01:13:14 +01:00
jesopo
0a93e76333 Use Timers.get_timers() instead of Timers.timers 2018-10-12 18:15:22 +01:00
jesopo
819f4e0680 Pass context-wrapped timers to each module, add ModuleManager.BaseModule.on_load 2018-10-12 18:07:23 +01:00
jesopo
cb94fa9ae4 Add TimersContext, to be able to purge timers when modules are unloaded 2018-10-12 17:54:15 +01:00
jesopo
d460375629 Use decimal.Decimal in utils.parse_number 2018-10-12 11:28:14 +01:00
jesopo
d427e29936 Actually pass format args to ValueErrors in utils.parse_number 2018-10-12 11:21:57 +01:00
jesopo
a810d273d1 int(number) after we've checked .isdigit() in utils.parse_number 2018-10-12 11:19:04 +01:00
jesopo
9771fc9f7a Add utils.parse_number, to turn 1k/1m/1b in to 1_000/1_000_000/1_000_000_000 2018-10-12 11:16:39 +01:00
jesopo
e6a55b2b22 Improve "non-complete line" TRACE log 2018-10-11 18:07:11 +01:00
jesopo
dceed3d439 TRACE log when we receive and buffer a non-complete line 2018-10-11 17:56:19 +01:00
jesopo
23b7223fae Add !syncmodes in modules/auto_mode.py, fire internal.identified in
modules/permissions.py and catch it in modules/auto_mode.py to give users modes
when they identify using the internal identity mechanism
2018-10-11 11:20:53 +01:00
jesopo
c655668bbe Add fallback_encoding to utils.http.get_url, in case a page has no implicit
encoding
2018-10-10 23:49:59 +01:00
jesopo
f286f3bf48 .decode data prior to json.loads in utils.http.get_url 2018-10-10 15:25:08 +01:00
jesopo
951c315cec Fix syntax error for throwing a timeout when signal.alarm fires 2018-10-10 15:07:04 +01:00
jesopo
015fa8ddff .decode plaintext returns from utils.http.get_url 2018-10-10 15:06:30 +01:00
jesopo
5b9ffe013d Use signal.alarm to Deadline utils.http.get_url and throw useful exceptions 2018-10-10 14:25:44 +01:00
jesopo
be75f72356 Set a max size of 100mb for utils.http.get_url 2018-10-10 14:05:15 +01:00
jesopo
68f5626189 Change utils.http to use requests 2018-10-10 13:41:58 +01:00
jesopo
c28a41ad21 Remove debug print in src.utils.http 2018-10-09 22:39:34 +01:00
jesopo
f69a1ce7c1 Return response code from utils.http.get_url when code=True and soup=True 2018-10-09 22:16:04 +01:00
jesopo
b144d5e37e Don't continue trying to use None data 2018-10-08 23:03:49 +01:00
jesopo
383767c7fb Support post_data in utils.http.get_url 2018-10-08 12:43:31 +01:00
jesopo
681866339c Support multiple types of comments in utils.get_hashflags 2018-10-07 11:24:13 +01:00
jesopo
29d8549da1 clear _trigger_functions after we've called all the waiting functions 2018-10-07 08:06:41 +01:00
jesopo
a77a985d5d Optionally take a function in IRCBot.trigger, a function to be called on the
main thread
2018-10-07 08:01:54 +01:00
jesopo
472d745401 Socket on_read functions take 2 args (socket, string) 2018-10-07 07:56:11 +01:00
jesopo
bb533ab9e8 This is a far less complicated way of triggering epoll.poll 2018-10-07 07:54:10 +01:00
Evelyn
661199aa54 Research suggests _config and config are not synonymous 2018-10-06 22:58:59 +01:00
jesopo
825fb15c87 Add control-socket to bot.conf.example, only start up control socket is a unix
domain socket location is provided
2018-10-06 18:31:00 +01:00
jesopo
9458d9fee2 'control_socket_client' -> '_control_client' in src/IRCBot.py 2018-10-06 16:42:38 +01:00
jesopo
90680c11ef Remove debug print in src/ControlSocket.py 2018-10-06 15:46:58 +01:00
jesopo
79aff93b5d Add a ControlSocket client to IRCBot.py, use it to trigger the epoll loop when a
github webhook has been caught!
2018-10-06 15:45:56 +01:00
jesopo
0794a5173a Add a way to track non-IRC sockets within the main epoll loop; use this for a
unix domain control socket!
2018-10-06 15:37:05 +01:00
jesopo
df94020ef5 Add database.find_by_setting, send github commits to interested channels 2018-10-06 09:54:21 +01:00
jesopo
60ec6fe2db 'ssl-certificate'/'ssl-key' -> 'tls-certificate'/'tls-key' 2018-10-05 23:01:12 +01:00
jesopo
096fd05cee Typo in utils, 'line.replace[3:]' -> 'line[3:]' 2018-10-04 16:01:34 +01:00
jesopo
f2d9ff9d3b Checking for the presence of the seperator in the return from .partition is a
more "correct" way of doing this
2018-10-04 15:27:52 +01:00
jesopo
feed251f82 Non-present hashflag values should be None, not empty string 2018-10-04 15:23:35 +01:00