mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2026-04-29 01:22:09 +02:00
Disabled test suite because it fails to properly run: > ERROR sopel/__init__.py - pkg_resources.DistributionNotFound: The 'sopel' > distribution was not found and is required by the application Upstream issue: https://github.com/sopel-irc/sopel/issues/1846
35 lines
1.1 KiB
Diff
35 lines
1.1 KiB
Diff
diff --git a/sopel/modules/help.py b/sopel/modules/help.py
|
|
index 7d8e227..c4f4f31 100644
|
|
--- a/sopel/modules/help.py
|
|
+++ b/sopel/modules/help.py
|
|
@@ -158,6 +158,21 @@ def post_to_ubuntu(msg):
|
|
|
|
return result.url
|
|
|
|
+def post_to_tpaste(msg):
|
|
+ try:
|
|
+ result = _requests_post_catch_errors('https://tpaste.us/', data={'tpaste': msg})
|
|
+ except PostingException:
|
|
+ raise
|
|
+
|
|
+ result = result.text
|
|
+ if re.match(r'https?://tpaste\.us/', result):
|
|
+ # find/replace just in case the site tries to be sneaky and save on SSL overhead,
|
|
+ # though it will probably send us an HTTPS link without any tricks.
|
|
+ return result.replace('http://', 'https://', 1)
|
|
+ else:
|
|
+ LOGGER.error("Invalid result %s", result)
|
|
+ raise PostingException('tpaste result did not contain expected URL base.')
|
|
+
|
|
|
|
PASTEBIN_PROVIDERS = {
|
|
'clbin': post_to_clbin,
|
|
@@ -165,6 +180,7 @@ PASTEBIN_PROVIDERS = {
|
|
'hastebin': post_to_hastebin,
|
|
'termbin': post_to_termbin,
|
|
'ubuntu': post_to_ubuntu,
|
|
+ 'tpaste': post_to_tpaste,
|
|
}
|
|
REPLY_METHODS = [
|
|
'channel',
|