diff libervia/cli/cmd_blog.py @ 4270:0d7bb4df2343

Reformatted code base using black.
author Goffi <goffi@goffi.org>
date Wed, 19 Jun 2024 18:44:57 +0200
parents 121925996ffb
children
line wrap: on
line diff
--- a/libervia/cli/cmd_blog.py	Tue Jun 18 12:06:45 2024 +0200
+++ b/libervia/cli/cmd_blog.py	Wed Jun 19 18:44:57 2024 +0200
@@ -86,7 +86,7 @@
     "content_xhtml",
     "title",
     "title_xhtml",
-    "extra"
+    "extra",
 )
 OUTPUT_OPT_NO_HEADER = "no-header"
 RE_ATTACHMENT_METADATA = re.compile(r"^(?P<key>[a-z_]+)=(?P<value>.*)")
@@ -130,9 +130,9 @@
                 f"invalid number of argument for {', '.join(self.option_strings)}, it "
                 "must have at most 2 arguments."
             )
-        alt_link = {'url': url}
+        alt_link = {"url": url}
         if media_type is not None:
-            alt_link['media_type'] = media_type
+            alt_link["media_type"] = media_type
         alt_links = getattr(namespace, self.dest)
         if alt_links is None:
             alt_links = []
@@ -189,20 +189,18 @@
             "--attachment",
             dest="attachments",
             nargs="+",
-            help=_(
-                "attachment in the form URL [metadata_name=value]"
-            )
+            help=_("attachment in the form URL [metadata_name=value]"),
         )
 
         self.parser.add_argument(
-            '--alt-link',
+            "--alt-link",
             action=AltLinkAction,
             dest="alt_links",
-            metavar=('URL', 'MEDIA_TYPE'),
+            metavar=("URL", "MEDIA_TYPE"),
             help=(
                 "add an alternative link, you can use {service}, {node} and {item} "
                 "template values in URL"
-            )
+            ),
         )
 
         comments_group = self.parser.add_mutually_exclusive_group()
@@ -228,7 +226,7 @@
         self.parser.add_argument(
             "--no-id-suffix",
             action="store_true",
-            help=_("do no add random suffix to friendly ID")
+            help=_("do no add random suffix to friendly ID"),
         )
 
         self.parser.add_argument(
@@ -240,19 +238,19 @@
             "-e",
             "--encrypt",
             action="store_true",
-            help=_("end-to-end encrypt the blog post")
+            help=_("end-to-end encrypt the blog post"),
         )
         self.parser.add_argument(
             "--encrypt-for",
             metavar="JID",
             action="append",
-            help=_("encrypt a single item for")
+            help=_("encrypt a single item for"),
         )
         self.parser.add_argument(
             "-X",
             "--sign",
             action="store_true",
-            help=_("cryptographically sign the blog post")
+            help=_("cryptographically sign the blog post"),
         )
 
     async def set_mb_data_content(self, content, mb_data):
@@ -301,7 +299,7 @@
                     value = m.group("value").strip()
                     if key == "external":
                         if not value:
-                            value=True
+                            value = True
                         else:
                             value = C.bool(value)
                     attachment[key] = value
@@ -1217,7 +1215,6 @@
         super().__init__(host)
         self.override_pubsub_flags({C.SERVICE, C.SINGLE_ITEM})
 
-
     async def start(self):
         if not self.args.node:
             namespaces = await self.host.bridge.namespaces_get()