Commit 0653c4f5 authored by zeroone2numeral2's avatar zeroone2numeral2
Browse files

Lints pt. 2

parent aab82989
......@@ -29,4 +29,4 @@ class FilteredRegexHandler(RegexHandler):
match = re.match(self.pattern, update.effective_message.text)
return bool(match)
return False
\ No newline at end of file
return False
......@@ -44,4 +44,4 @@ class module:
CommandHandler(["start", "help"], help_message, filters=Filters.private),
CallbackQueryHandler(on_extended_help_button, pattern='^extend$'),
CallbackQueryHandler(on_short_help_button, pattern='^reduce$'),
)
\ No newline at end of file
)
......@@ -27,9 +27,10 @@ def on_sed(_, update, groups):
text = update.message.reply_to_message.text or update.message.reply_to_message.caption
mode = groups[0]
pattern = groups[1]
replacement = groups[2].replace('\\/', '/') # ??? https://github.com/SijmenSchoon/regexbot/blob/master/regexbot.py#L25
replacement = groups[2].replace('\\/', '/') # ??? https://github.com/SijmenSchoon/regexbot/blob/master/regexbot.py#L25
flags = groups[3] if len(groups) > 3 else None
logger.info("\nmode: %s\ntext: %s\npattern: %s\nreplacement: %s\nflags: %s",
logger.info(
"\nmode: %s\ntext: %s\npattern: %s\nreplacement: %s\nflags: %s",
mode,
text,
pattern,
......@@ -44,7 +45,7 @@ def on_sed(_, update, groups):
logger.info("re.subn result:\nnew_string: %s\nn_subs: %d", new_string, n_subs)
except Exception as e:
logger.info("re.subn exception: %s", str(e), exc_info=True)
#update.message.reply_text(s.oopsie_woopsie) # might be the user who fucked up the regex
# update.message.reply_text(s.oopsie_woopsie) # might be the user who fucked up the regex
return # don't proceed further
if n_subs > 0:
......@@ -62,6 +63,5 @@ def on_sed(_, update, groups):
class module:
name = "sed"
handlers = (
FilteredRegexHandler(COMMAND_REGEX, on_sed, pass_groups=True,
filters=Filters.reply_text),
)
\ No newline at end of file
FilteredRegexHandler(COMMAND_REGEX, on_sed, pass_groups=True, filters=Filters.reply_text),
)
......@@ -45,4 +45,4 @@ yesno_list = (
'No.',
'Absolutely.',
'In your dreams.'
)
\ No newline at end of file
)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment