mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-12 13:12:35 +01:00
SedRegex: rename SearchNotFound -> SearchNotFoundError
This commit is contained in:
parent
b05fe01d66
commit
d52e2aa829
@ -57,7 +57,7 @@ from .constants import SED_REGEX, TAG_SEEN, TAG_IS_REGEX
|
|||||||
# Replace newlines and friends with things like literal "\n" (backslash and "n")
|
# Replace newlines and friends with things like literal "\n" (backslash and "n")
|
||||||
axe_spaces = utils.str.MultipleReplacer({'\n': '\\n', '\t': '\\t', '\r': '\\r'})
|
axe_spaces = utils.str.MultipleReplacer({'\n': '\\n', '\t': '\\t', '\r': '\\r'})
|
||||||
|
|
||||||
class SearchNotFound(Exception):
|
class SearchNotFoundError(Exception):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
class SedRegex(callbacks.PluginRegexp):
|
class SedRegex(callbacks.PluginRegexp):
|
||||||
@ -158,7 +158,7 @@ class SedRegex(callbacks.PluginRegexp):
|
|||||||
timeout=regex_timeout, pn=self.name(), cn='replacer')
|
timeout=regex_timeout, pn=self.name(), cn='replacer')
|
||||||
except ProcessTimeoutError:
|
except ProcessTimeoutError:
|
||||||
irc.error(_("Search timed out."))
|
irc.error(_("Search timed out."))
|
||||||
except SearchNotFound:
|
except SearchNotFoundError:
|
||||||
irc.error(_("Search not found in the last %i IRC messages on this network.") %
|
irc.error(_("Search not found in the last %i IRC messages on this network.") %
|
||||||
len(irc.state.history))
|
len(irc.state.history))
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
@ -223,7 +223,7 @@ class SedRegex(callbacks.PluginRegexp):
|
|||||||
|
|
||||||
self.log.debug(_("SedRegex: Search %r not found in the last %i messages of %s."),
|
self.log.debug(_("SedRegex: Search %r not found in the last %i messages of %s."),
|
||||||
msg.args[1], len(irc.state.history), msg.args[0])
|
msg.args[1], len(irc.state.history), msg.args[0])
|
||||||
raise SearchNotFound()
|
raise SearchNotFoundError()
|
||||||
|
|
||||||
Class = SedRegex
|
Class = SedRegex
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user