diff options
Diffstat (limited to '')
-rw-r--r-- | archivist/cli.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/archivist/cli.py b/archivist/cli.py index 5478de5..7bdf213 100644 --- a/archivist/cli.py +++ b/archivist/cli.py @@ -22,7 +22,6 @@ def enable_debug(): def cli(debug): if debug or 'DEBUG' in os.environ: enable_debug() - class ServerCommand(ProxyCommand): def _get_proxy(self): from .server import server_group @@ -127,7 +126,7 @@ def edit_prefix(name, implies, description): try: prefix = Prefix.get(name = name) except Prefix.DoesNotExist: - raise click.UsageError("Prefix '%s' does not exist." % name) + raise click.UsageError(f"Prefix '{name}' does not exist.") with db.atomic(): add_implications(prefix.default_tag, implies) @@ -224,7 +223,7 @@ def store_doc(id, path, parents): try: d = Document.get(id = id) except Document.DoesNotExist: - print("Document with ID #%s does not exist" % id) + print("Document with ID #{id} does not exist") return if path in (b'-', '-'): @@ -237,7 +236,7 @@ def store_doc(id, path, parents): if parents: p.parent.mkdir(parents=True) elif not p.parent.exists(): - raise click.UsageError("Directory %s does not exist (use option '-p'?)." % p.parent) + raise click.UsageError(f"Directory {p.parent} does not exist (use option '-p'?).") with p.open(mode='wb') as f: f.write(d.content.blob) @@ -251,7 +250,7 @@ def open_doc(id): try: d = Document.get(id = id) except Document.DoesNotExist: - print("Document with ID #%s does not exist" % id) + print(f"Document with ID #{id} does not exist") return with tempfile.TemporaryDirectory() as tmpdir: |