Mercurial > libervia-backend
comparison sat/memory/params.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 | 358a678e5bdf |
comparison
equal
deleted
inserted
replaced
3541:888109774673 | 3573:813595f88612 |
---|---|
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: |