diff sat_frontends/jp/cmd_invitation.py @ 3573:813595f88612

merge changes from main branch
author Goffi <goffi@goffi.org>
date Thu, 17 Jun 2021 13:05:58 +0200
parents 04283582966f
children 524856bd7b19
line wrap: on
line diff
--- a/sat_frontends/jp/cmd_invitation.py	Thu Jun 03 15:21:43 2021 +0200
+++ b/sat_frontends/jp/cmd_invitation.py	Thu Jun 17 13:05:58 2021 +0200
@@ -162,9 +162,7 @@
         )
 
     def add_parser_options(self):
-        self.parser.add_argument(
-            "id", help=_("invitation UUID")
-        )
+        self.parser.add_argument("id", help=_("invitation UUID"))
         self.parser.add_argument(
             "-j",
             "--with-jid",
@@ -184,7 +182,7 @@
                 self.args.id,
             )
         except Exception as e:
-            self.disp(msg=_(f"can't get invitation data: {e}"), error=True)
+            self.disp(msg=_("can't get invitation data: {e}").format(e=e), error=True)
             self.host.quit(C.EXIT_BRIDGE_ERRBACK)
 
         if not self.args.with_jid:
@@ -197,7 +195,7 @@
                     profile,
                 )
             except Exception as e:
-                self.disp(msg=_(f"can't start session: {e}"), error=True)
+                self.disp(msg=_("can't start session: {e}").format(e=e), error=True)
                 self.host.quit(C.EXIT_BRIDGE_ERRBACK)
 
             try:
@@ -207,7 +205,7 @@
                     profile_key=profile,
                 )
             except Exception as e:
-                self.disp(msg=_(f"can't retrieve jid: {e}"), error=True)
+                self.disp(msg=_("can't retrieve jid: {e}").format(e=e), error=True)
                 self.host.quit(C.EXIT_BRIDGE_ERRBACK)
 
             await self.output_data(invitation_data, jid_)
@@ -224,9 +222,7 @@
         )
 
     def add_parser_options(self):
-        self.parser.add_argument(
-            "id", help=_("invitation UUID")
-        )
+        self.parser.add_argument("id", help=_("invitation UUID"))
 
     async def start(self):
         try:
@@ -234,7 +230,7 @@
                 self.args.id,
             )
         except Exception as e:
-            self.disp(msg=_(f"can't delete guest account: {e}"), error=True)
+            self.disp(msg=_("can't delete guest account: {e}").format(e=e), error=True)
             self.host.quit(C.EXIT_BRIDGE_ERRBACK)
 
         self.host.quit()
@@ -290,9 +286,7 @@
             default="",
             help="profile doing the invitation (default: don't associate profile",
         )
-        self.parser.add_argument(
-            "id", help=_("invitation UUID")
-        )
+        self.parser.add_argument("id", help=_("invitation UUID"))
 
     async def start(self):
         extra = dict(self.args.extra)
@@ -302,7 +296,9 @@
                 continue
             if arg_name in extra:
                 self.parser.error(
-                    _(f"you can't set {arg_name} in both optional argument and extra")
+                    _(
+                        "you can't set {arg_name} in both optional argument and extra"
+                    ).format(arg_name=arg_name)
                 )
             extra[arg_name] = value
         try:
@@ -312,9 +308,7 @@
                 self.args.replace,
             )
         except Exception as e:
-            self.disp(
-                f"can't modify invitation: {e}", error=True
-            )
+            self.disp(f"can't modify invitation: {e}", error=True)
             self.host.quit(C.EXIT_BRIDGE_ERRBACK)
         else:
             self.disp(_("invitations have been modified successfuly"))