aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMirek Kratochvil <exa.exa@gmail.com>2025-10-12 14:07:08 +0200
committerMirek Kratochvil <exa.exa@gmail.com>2025-10-12 14:07:08 +0200
commitdc30ac33ec765d476ba3b1f74b91f3d2cbccccf9 (patch)
tree2f08e57fdc3749f704e3b6bea28bf018322c4c8c
parent18dea375955a00302f1a2db8d7964dfffc49746c (diff)
downloadpatchodon-dc30ac33ec765d476ba3b1f74b91f3d2cbccccf9.tar.gz
patchodon-dc30ac33ec765d476ba3b1f74b91f3d2cbccccf9.tar.bz2
o k a y
-rwxr-xr-xpatchodon.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/patchodon.py b/patchodon.py
index 9086666..6f5bd2b 100755
--- a/patchodon.py
+++ b/patchodon.py
@@ -13,9 +13,9 @@ import time
VERSION = "0.1.0"
-DPASTE_URL = "https://dpaste.com" # TODO any good way to parametrize this?
+DPASTE_URL = "https://dpaste.com" # TODO any good way to parametrize this?
-STATUS_LENGTH_LIMIT = 400 # TODO obtain from instance
+STATUS_LENGTH_LIMIT = 400 # TODO obtain from instance
def trace(x):
@@ -64,7 +64,7 @@ def do_pastebin_file(file):
# DPASTE API USE RULES:
# - user-agent must be set properly
# - 1 second between requests
- trace(f"pasting {file}...")
+ trace(f"sending `{file}' to dpaste...")
r = requests.post(
DPASTE_URL + "/api/v2/",
data={
@@ -75,9 +75,9 @@ def do_pastebin_file(file):
},
headers={"User-agent": f"patchodon v{VERSION}"},
)
+ time.sleep(1.1)
if r.status_code != 201:
raise (f"dpaste POST failed for `{file}'")
- time.sleep(1.1)
return r.headers["location"] + ".txt"
@@ -111,7 +111,7 @@ def do_post(args):
trace("posting the header...")
parent_post_id, url = do_post_status(
args,
- f"{mayline(args.recipient)} {mayline(args.subject)}\n"
+ f"{mayline(args.recipient)}{mayline(args.subject)}"
f"[patchodon hash {full_hash} / {' '.join(short_hashes)}]",
)
for fn, pst, hsh, series in zip(