Commit Graph

36 Commits

Author SHA1 Message Date
Valentin Lorentz
74f86654b1 Remove fallbacks for old Python versions. 2022-01-01 18:11:36 +01:00
Valentin Lorentz
63eb6672ea Revert generic 'The Limnoria Contributors' in copyright notices
This commit reverts db7ef3f025
(though it keeps the year updates)

After discussion with several people, it seems better to mention
copyright owners explicitly. eg. https://reuse.software/faq/#vcs-copyright
explains the issue of using VCSs to track copyright.

As db7ef3f025 only replaced mentions
of my name with 'The Limnoria Contributors', this commit only needs
to undo that + add one person who contributed to setup.py.
2021-10-17 09:57:55 +02:00
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
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
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
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
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
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
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
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
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
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
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
James Lu
fa13c68ebc SedRegex: work around "nothing to repeat" errors on Python < 2.7.6
Source: https://stackoverflow.com/questions/3675144/regex-error-nothing-to-repeat and https://bugs.python.org/issue18647

From: 335fc6e3da
2020-01-01 21:55:58 -08:00
James Lu
1499141f09 Import SedRegex plugin as of 2a556a1b84
Co-authored-by: Michael Daniel Telatynski <postmaster@webdevguru.co.uk>
Co-authored-by: nyuszika7h <nyuszika7h@openmailbox.org>
2020-01-01 21:55:57 -08:00