comparison 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
comparison
equal deleted inserted replaced
3567:a240748ed686 3568:04283582966f
970 ) 970 )
971 return defer.succeed(None) 971 return defer.succeed(None)
972 972
973 if not self.checkSecurityLimit(node[1], security_limit): 973 if not self.checkSecurityLimit(node[1], security_limit):
974 msg = _( 974 msg = _(
975 f"{profile!r} is trying to set parameter {name!r} in category " 975 "{profile!r} is trying to set parameter {name!r} in category "
976 f"{category!r} without authorization!!!") 976 "{category!r} without authorization!!!").format(
977 profile=repr(profile),
978 name=repr(name),
979 category=repr(category)
980 )
977 log.warning(msg) 981 log.warning(msg)
978 raise exceptions.PermissionError(msg) 982 raise exceptions.PermissionError(msg)
979 983
980 type_ = node[1].getAttribute("type") 984 type_ = node[1].getAttribute("type")
981 if type_ == "int": 985 if type_ == "int":
984 else: 988 else:
985 try: 989 try:
986 int(value) 990 int(value)
987 except ValueError: 991 except ValueError:
988 log.warning(_( 992 log.warning(_(
989 f"Trying to set parameter {name!r} in category {category!r} with" 993 "Trying to set parameter {name} in category {category} with"
990 f"an non-integer value" 994 "an non-integer value"
995 ).format(
996 name=repr(name),
997 category=repr(category)
991 )) 998 ))
992 return defer.succeed(None) 999 return defer.succeed(None)
993 if node[1].hasAttribute("constraint"): 1000 if node[1].hasAttribute("constraint"):
994 constraint = node[1].getAttribute("constraint") 1001 constraint = node[1].getAttribute("constraint")
995 try: 1002 try: