This commit is contained in:
boyska 2024-11-26 00:48:13 +01:00
parent f0bcfc2f4d
commit 3848769108

View file

@ -7,7 +7,6 @@ import json
from base64 import b64encode
from pathlib import Path
from argparse import ArgumentParser
from subprocess import Popen, PIPE
import subprocess
import tempfile
import logging
@ -102,10 +101,10 @@ class ArchiveBackend:
def reserve(self, filename: Path) -> str:
bucketbase = re.sub(
r"""[^a-zA-Z0-9_.-]""", # based on what the archive.org documentation says
"_",
filename.name.rsplit(".", maxsplit=1)[0]
)
r"""[^a-zA-Z0-9_.-]""", # based on what the archive.org documentation says
"_",
filename.name.rsplit(".", maxsplit=1)[0],
)
if not bucketbase.startswith(f"{self.bucketprefix}-"):
bucketbase = f"{self.bucketprefix}-" + bucketbase
bucketname = bucketbase
@ -273,7 +272,6 @@ class Carichello:
def set_clipboard(self, text: str):
subprocess.run(["xsel", "-bi"], input=text.encode("utf8"))
def run(self) -> int:
try:
ret = self._run()