Mercurial > libervia-backend
comparison sat/plugins/plugin_import.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 | be6d91572633 |
children | 524856bd7b19 |
comparison
equal
deleted
inserted
replaced
3567:a240748ed686 | 3568:04283582966f |
---|---|
62 - publishItem: actualy publish an item | 62 - publishItem: actualy publish an item |
63 - itemFilters: modify item according to options | 63 - itemFilters: modify item according to options |
64 @param name(unicode): import handler name | 64 @param name(unicode): import handler name |
65 """ | 65 """ |
66 assert name == name.lower().strip() | 66 assert name == name.lower().strip() |
67 log.info(_(f"initializing {name} import handler")) | 67 log.info(_("initializing {name} import handler").format(name=name)) |
68 import_handler.name = name | 68 import_handler.name = name |
69 import_handler.register = partial(self.register, import_handler) | 69 import_handler.register = partial(self.register, import_handler) |
70 import_handler.unregister = partial(self.unregister, import_handler) | 70 import_handler.unregister = partial(self.unregister, import_handler) |
71 import_handler.importers = {} | 71 import_handler.importers = {} |
72 | 72 |
153 options[option] = json.loads(options[option]) | 153 options[option] = json.loads(options[option]) |
154 except KeyError: | 154 except KeyError: |
155 pass | 155 pass |
156 except ValueError: | 156 except ValueError: |
157 raise exceptions.DataError( | 157 raise exceptions.DataError( |
158 _(f"invalid json option: {option}") | 158 _("invalid json option: {option}").format(option=option) |
159 ) | 159 ) |
160 pubsub_service = jid.JID(pubsub_service) if pubsub_service else None | 160 pubsub_service = jid.JID(pubsub_service) if pubsub_service else None |
161 return self.doImport( | 161 return self.doImport( |
162 client, | 162 client, |
163 import_handler, | 163 import_handler, |