Commit graph

65 commits

Author SHA1 Message Date
jesopo
d454f9b732 use Queue.get() with timeout, not Process.join() for timeout
this was because the threads spawned by multiprocessing.Queue seemed to be
making Process.join() believe the subprocess had not exited.
2019-09-17 13:39:23 +01:00
jesopo
1ed14f9a17 first draft of multiprocess.Process deadline system 2019-09-17 11:56:30 +01:00
jesopo
f9d13dc373 support '0' as an IntSetting value 2019-09-15 22:22:30 +01:00
jesopo
d950eb3660 add utils.SensitiveSetting, to .format() hide value 2019-09-12 12:17:31 +01:00
jesopo
ba0911f2e7 add utils.Setting.format() so subtypes can format differently 2019-09-12 12:17:09 +01:00
jesopo
007bb78d30 make utils.from_pretty_time() format much stricter 2019-09-04 11:22:56 +01:00
jesopo
d42d694e64 move deadline alarm time check inside try/finally 2019-09-02 15:50:12 +01:00
jesopo
9e43ea1599 add per-user fediverse setting 2019-09-02 08:51:56 +01:00
jesopo
722d6418c8 switch to using signal.setitimer so we can restore previous timer 2019-08-30 18:36:48 +01:00
jesopo
a57a06b1cc switch utils.deadline to a context manager 2019-08-30 18:13:12 +01:00
jesopo
e97e3c8f30 add utils.deadline(func, seconds) to put hard limits on code exec time 2019-08-30 17:17:03 +01:00
jesopo
4bfb4c3200 Add IntRangeSetting, reorder OptionsSetting arg order 2019-08-30 14:40:54 +01:00
jesopo
58a4fd7e74 round microseconds up to a whole number and zero-pad to 3 chars 2019-08-30 13:46:00 +01:00
jesopo
d3ed08e336 Don't use 'Z' for "utc timezone" - actually parse timezone out of datetimes 2019-08-30 13:25:19 +01:00
jesopo
77dfc76591 switch to function/module magic being a single object 2019-07-26 11:58:06 +01:00
jesopo
19f716ab4c Implemnt _options_factory for OptionsSetting to have dynamic options 2019-06-29 22:26:28 +01:00
jesopo
b4c762eb4e Automatically format example text for OptionsSetting (showing options) 2019-06-29 21:33:26 +01:00
jesopo
7091860e54 Setting.__init__ call in OptionsSetting ctor needs self param 2019-06-28 23:27:56 +01:00
jesopo
756396d758 Implement utils.OptionsSetting 2019-06-28 23:26:42 +01:00
jesopo
ae9d099a41 Refactor set/channelset/serverset/botset in to 'utils.Setting' objects 2019-06-28 23:16:05 +01:00
jesopo
3c3f0449b6 add CaseInsensitiveDict.__contains__ 2019-06-26 17:57:49 +01:00
jesopo
c5785a2d14 implement @utils.kwarg() magic, use it for command.regex hooks 2019-06-26 14:37:41 +01:00
jesopo
ced59a0f74 Allow channel-access and channel-mode check for channels people are not in 2019-06-16 20:48:31 +01:00
jesopo
8ab4880c5c Change from yield checks to a func in events that pass up EventErrors 2019-06-15 18:42:14 +01:00
jesopo
e0d99fe8b1 Fix utils.Check args type hinting 2019-06-14 12:12:38 +01:00
jesopo
f05fc209b0 Add a way to __or__ utils.Checks, as a "if one of these passes" thing 2019-06-14 12:01:55 +01:00
jesopo
d7fa2cfa24 Catch yields in command callbacks for e.g. permission checks 2019-06-14 11:42:12 +01:00
jesopo
0afe798b83 Support parsing iso8601 with microseconds 2019-04-28 12:11:48 +01:00
jesopo
e095c56f77 Record and show when a !to was created 2019-04-24 14:32:56 +01:00
jesopo
87340bcbf9 change utils.iso8601_format to default to no milliseconds, switch to using
utils.iso8601 functions in badges.py
2019-04-23 21:27:43 +01:00
jesopo
0eaeca8f83 Put spaces between units in output from utils.to_pretty_time 2019-03-21 17:59:42 +00:00
jesopo
5d7f017c9c Enum values shouldn't be all upper case 2019-03-10 13:14:25 +00:00
jesopo
d627ed49e2 Pull "is main thread" logic out to utils, force Database to be accessed on main
thread
2019-02-25 10:36:17 +00:00
jesopo
8c94bcf6ca Move utils.irc.IRCParsedLine to IRCLine.ParsedLine, improve truncation
mechanism, don't convert sent line from ParsedLine to text to ParsedLine for
line_handler handling
2019-02-23 21:33:04 +00:00
jesopo
47c2cbb0fa Split line_handler.py out in to different files for different categories 2019-02-22 11:23:36 +00:00
jesopo
cb0314da67 Put a helper function in utils to do iso8601 formatting. change IRCServer's
last-read setting to use it.
2019-02-17 14:15:40 +00:00
jesopo
8c9626f0a9 Put an strf format for ISO8601 in utils 2019-02-12 11:08:24 +00:00
jesopo
bd9eaad0b2 Return truncted data from encode_truncate and hold it in IRCLine.Line 2019-02-10 18:16:19 +00:00
jesopo
f2c762a2d0 add utils.truncate_encode, to encode and truncate a string while respecting utf8 multi-byte encoding 2019-02-10 16:41:56 +00:00
jesopo
e558a7676b Abstract ssl socket wrapping away so we can reuse it 2019-02-10 12:36:52 +00:00
jesopo
d86a0fc55c Return "0s" from utils.to_pretty_time when given 0 seconds 2019-02-07 22:47:03 +00:00
jesopo
1895ac34d7 If a server has a hostname that's not an IP, use it as SNI server name 2019-02-06 18:11:19 +00:00
jesopo
1c546a8244 Add typing hints to CaseInsensitiveDict, fix it's __setitem__ signature, call
.items() on `other` in ctor
2018-12-08 09:13:01 +00:00
jesopo
9bef4b7df1 Switch to using a case insensitive dictionary for headers instead of doing
.title() on each header key
2018-12-08 09:00:12 +00:00
jesopo
756c543c32 Typo in utils.__init__, 'number' -> 'number_str' 2018-11-16 17:45:40 +00:00
jesopo
73c0c911d4 Move logic for adding a server to the database out to utils.cli and add a
--add-server flag for start.py, to add new server
2018-11-13 10:40:49 +00:00
jesopo
a4d8d1f855 Fix some non-explicit None returns, add type hints to important variables 2018-10-31 15:12:46 +00:00
jesopo
b543e31cd2 Fix/refactor issues brought up by type hint linting 2018-10-30 17:49:35 +00:00
jesopo
e07553c362 Add type/return hints throughout src/ and, in doing so, fix some cyclical
references.
2018-10-30 14:58:48 +00:00
jesopo
50e7aa40b9 Typo in utils.parse_docstring, 'multiple_items' -> 'var_items' 2018-10-28 11:53:44 +00:00