Commit Graph

52 Commits

Author SHA1 Message Date
Valentin Lorentz
db7ef3f025 all: Add generic 'The Limnoria Contributors' to copyright notices.
No need to bother with details (that are all outdated / out of sync
anyway), just look up the git history.
2021-08-01 21:54:49 +02:00
James Lu
64ae28c0b8 Remove references to my old nick 2021-07-03 16:42:13 -07:00
Valentin Lorentz
14e637f4af SedRegex: Fix NameError in config setup 2021-05-22 18:51:35 +02:00
Valentin Lorentz
fec6959acb all plugins: regenerate READMEs 2021-04-22 00:29:15 +02:00
Valentin Lorentz
82fbfcffa4 all plugins: regenerate READMEs 2021-04-17 20:09:33 +02:00
Valentin Lorentz
833af36b08 all plugins: auto-generate READMEs
Starting with this commit, there should be no "original" text
in READMEs.
Instead, the entire text should be in docstrings, and READMEs
should be automatically generated from these docstrings.

Motivation:

* The same help is available both via IRC and in the README
  (although the README can be more detailed, as only the first
  paragraph will be shown on IRC)
* This will allow auto-generating plugin help on docs.limnoria.net
  using the same content as the README, as it's sourced from the
  docstrings

Additionally, this converts all READMEs from Markdown to ReST,
because the documentation already uses ReST, and other docstrings
in the codebase are in ReST for this reason.
2021-04-05 17:42:31 +02:00
James Lu
5ee63ebe96 SedRegex: test "nick, " prefix for explicit reference as well as "nick: " 2020-10-18 13:44:05 -07:00
James Lu
6c138d66ba SedRegex: follow config preference for strictRfc checking
Also add some tests to check that nicks containing the sed separator character are handled correctly.
2020-10-18 13:44:05 -07:00
James Lu
d52e2aa829 SedRegex: rename SearchNotFound -> SearchNotFoundError 2020-10-12 19:50:53 -07:00
James Lu
b05fe01d66 SedRegex: reword "search not found" error
"Search not found in the last X *messages*" is a bit confusing because this is really counting the entire history, which includes all other lines of IRC communication (this means pings, /NAMES replies and so on).
2020-10-12 19:48:56 -07:00
James Lu
9adb4f0e8c SedRegex: ignore regexp-like messages sent before the plugin is active
Reported by fred` at #limnoria.

This adds a new message tag applied to all messages SedRegex has seen, in addition to the one for marking messages parsed as a regexp.
SedRegex will now look through the message history and check that all messages without the "seen" tag are not in fact a regexp, before
marking it as seen so that it doesn't do repeated work.
2020-10-12 19:45:18 -07:00
James Lu
ffa24bf56e SedRegex: add a no match test case 2020-10-12 18:53:54 -07:00
Valentin Lorentz
0e2b0a96c8 SedRegex: Log error exceptions from the replacer. 2020-06-20 12:38:44 +02:00
Valentin Lorentz
37a7029618 SedRegex: when looking up config vars, strip statusmsg prefix from channel, and use network name for lookup. 2020-04-11 15:04:11 +02:00
Valentin Lorentz
2953126fca test: Make assertNoResponse default to a non-zero timeout for threaded plugins.
Else it doesn't reliably check there is no response.
2020-04-11 00:17:16 +02:00
Valentin Lorentz
7e48ba0ba8 SedRegex: Use assertSnarfNoResponse instead of assertNoResponse.
assertNoResponse was only passing by accident on faster machines.
2020-04-11 00:16:01 +02:00
James Lu
c212ee0e5e SedRegex: allow matching text with the trailing suffix missing
From: 866875ec5d
2020-04-02 10:00:40 -07:00
James Lu
c399272173 SedRegex: make callback matching case sensitive
This fixes a TypeError issue mentioned in d296bbb949.
2020-04-02 10:00:39 -07:00
James Lu
13c03716c5 Revert "SedRegex: Make pattern case-insensitive."
This reverts commit d296bbb949.
2020-04-02 09:47:32 -07:00
Valentin Lorentz
d296bbb949 SedRegex: Make pattern case-insensitive.
To fixes a mismatch between callbacks, which use flags=re.I by default,
and SED_REGEX.search which isn't; so 'S/foo/bar/' errored because it
matches case-insensitively so _unpack_sed is entered, but then _unpack_sed
fails to match it case-sensitively.
2020-04-02 17:30:57 +02:00
James Lu
d3b991895c SedRegex: skip testReDoSTimeout if multiprocessing is disabled 2020-01-27 08:00:46 -08:00
James Lu
51f10dbb60 SedRegex: update plugin metadata 2020-01-01 21:56:40 -08:00
James Lu
35dd3c3d9c Update plugin author/maintainer data
From: cbd953b32c
2020-01-01 21:55:58 -08:00
Valentin Lorentz
08764b85ef SedRegex: spawn a single process to handle the whole history.
This is more efficient than spawning up to 1000 processes (assuming
Limnoria's default config).

From: ede85ca8b0
2020-01-01 21:55:58 -08:00
James Lu
9e0db63b5b SedRegex: add test for ReDoS timeout
From: 81debc45ec
2020-01-01 21:55:58 -08:00
James Lu
1267d6452e SedRegex: abort when a search times out
This requires commit b54d8f8073, which separates the timeout and no match cases.

Also, raise the default processTimeout as the plugin now aborts on the first message that times out.

From: e5af479939
2020-01-01 21:55:58 -08:00
James Lu
43d4861577 Update my email & repo link references
From: 2ae51939b3
2020-01-01 21:55:58 -08:00
James Lu
6c54352713 SedRegex: test case normalization of channel names
From: 5672008a31
2020-01-01 21:55:58 -08:00
James Lu
937930ab6a SedRegex: match channel names case insensitively
Some IRCds (Unreal 3.2) don't mangle target names for case correctness, leading to a bug where users end up ignored by the plugin.

Reported by DOMF via IRC.

From: e19abe0498
2020-01-01 21:55:58 -08:00
James Lu
67a3928e4d SedRegex: log all errors, always display the not found mesage
From: fdab0edbc8
2020-01-01 21:55:58 -08:00
James Lu
06f70e59da SedRegex: reuse processTimeout in the sub() process too
From: 4e08442cde
2020-01-01 21:55:58 -08:00
James Lu
363285cfbf README: specifically mention that /s is specific to this plugin
[skip ci]

From: 5e6c9349fa
2020-01-01 21:55:58 -08:00
James Lu
e831d0e8ec SedRegex: make the regexp process timeout configurable
Although the default has been adequate on my systems, busy or low-powered machines may fail to process regexps quickly enough and cause SedRegex to sporadically error.

Reported by @cottongin via IRC.

From: 51ff41251b
2020-01-01 21:55:58 -08:00
James Lu
fd7aa571e9 SedRegex: remove compatibility workaround for Python 2.7.6 and lower
From: c9bcbbb934
2020-01-01 21:55:58 -08:00
James Lu
1646ca25c2 SedRegex: skip testBoldReplacement on Python 2
I don't know why it breaks here and I don't really care.

From: b9481184cb
2020-01-01 21:55:58 -08:00
James Lu
dcadb7e73b SedRegex: remove a duplicate test
From: 5e77c65a5f
2020-01-01 21:55:58 -08:00
James Lu
01e0c12641 SedRegex: use self.__class__ instead of __class__ in tests (Python 2 compat)
From: b53e6e40a0
2020-01-01 21:55:58 -08:00
James Lu
b01c50cd4d SedRegex: add a bunch of test cases
Closes #53.

From: a58785fa4a
2020-01-01 21:55:58 -08:00
James Lu
f40d8c530f SedRegex: bump copyright year to 2017
From: 0ef8138ab3
2020-01-01 21:55:58 -08:00
James Lu
90ec8a6976 SedRegex: fix some replacement queries not working
From: 926454b01d
2020-01-01 21:55:58 -08:00
James Lu
6445e90ec7 SedRegex: also catch errors in the regexp_wrapper() step
E.g. sre_constants.error: invalid group reference

From: e137d29eb9
2020-01-01 21:55:58 -08:00
James Lu
5370296bbf SedRegex: log the exact error name instead of "SedRegex error"
From: 406d7b1790
2020-01-01 21:55:58 -08:00
James Lu
dee2b6bdb3 SedRegex: require ending delimiter to prevent overzealous matching of replacement text
Closes #59.

From: 414a4a4a16
2020-01-01 21:55:58 -08:00
James Lu
656d2172db SedRegex: work around "nothing to replace" errors on < Python 2.7.6 again
From: 244a8c6bee
2020-01-01 21:55:58 -08:00
James Lu
889c6a1615 SedRegex: fix flag matching
From: db125ee5d1
2020-01-01 21:55:58 -08:00
James Lu
c1c423cc0d SedRegex: add configuration / usage instructions
From: 9d0dce6ef5
2020-01-01 21:55:58 -08:00
James Lu
24ae250ac4 SedRegex: implement 's' regex flag to only match the caller's message
From: 87c79db3d0
2020-01-01 21:55:58 -08:00
James Lu
bd0b1158fc SedRegex: allow free form flags and return them in _unpack_sed()
From: 423da9f996
2020-01-01 21:55:58 -08:00
James Lu
c1e2e2b8a6 SedRegex: sanitize against \n\r\t in output
From: 48445e256a
2020-01-01 21:55:58 -08:00
James Lu
00f26b0a73 SedRegex: only operate on messages from the current network
Reported by @jztech101.

The 'receivedBy' tag is now checked to match the current IRC object, which Works around ProgVal/Limnoria#1211.

From: 84b94d589c
2020-01-01 21:55:58 -08:00