diff sat/memory/params.py @ 3568:04283582966f

core, frontends: fix invalid translatable strings. Some f-strings where used in translatable text, this has been fixed by using explicit `format()` call (using a script based on `tokenize`). As tokenize messes with spaces, a reformating tool (`black`) has been applied to some files afterwards.
author Goffi <goffi@goffi.org>
date Mon, 14 Jun 2021 18:35:12 +0200
parents 7550ae9cfbac
children 358a678e5bdf
line wrap: on
line diff
--- a/sat/memory/params.py	Mon Jun 14 12:19:21 2021 +0200
+++ b/sat/memory/params.py	Mon Jun 14 18:35:12 2021 +0200
@@ -972,8 +972,12 @@
 
         if not self.checkSecurityLimit(node[1], security_limit):
             msg = _(
-                f"{profile!r} is trying to set parameter {name!r} in category "
-                f"{category!r} without authorization!!!")
+                "{profile!r} is trying to set parameter {name!r} in category "
+                "{category!r} without authorization!!!").format(
+                    profile=repr(profile),
+                    name=repr(name),
+                    category=repr(category)
+                )
             log.warning(msg)
             raise exceptions.PermissionError(msg)
 
@@ -986,8 +990,11 @@
                     int(value)
                 except ValueError:
                     log.warning(_(
-                        f"Trying to set parameter {name!r} in category {category!r} with"
-                        f"an non-integer value"
+                        "Trying to set parameter {name} in category {category} with"
+                        "an non-integer value"
+                    ).format(
+                        name=repr(name),
+                        category=repr(category)
                     ))
                     return defer.succeed(None)
                 if node[1].hasAttribute("constraint"):