From 7b8fa3c432ca14e985aa65ab5b33d09b899f138b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20H=C3=B6rist?= Date: Sat, 25 Jan 2025 20:56:23 +0100 Subject: [PATCH] cq: Format strings --- acronyms_expander/acronyms_expander.py | 2 +- anti_spam/config_dialog.py | 12 +++++------- anti_spam/modules/anti_spam.py | 6 +++--- message_box_size/msg_box_size.py | 2 +- pgp/backend/store.py | 6 +++--- pgp/modules/pgp_legacy.py | 4 ++-- triggers/gtk/config.py | 2 +- 7 files changed, 16 insertions(+), 18 deletions(-) diff --git a/acronyms_expander/acronyms_expander.py b/acronyms_expander/acronyms_expander.py index bff3d21..2ce5922 100644 --- a/acronyms_expander/acronyms_expander.py +++ b/acronyms_expander/acronyms_expander.py @@ -42,7 +42,7 @@ log = logging.getLogger("gajim.p.acronyms") class AcronymsExpanderPlugin(GajimPlugin): def init(self) -> None: self.description = _( - "Replaces acronyms (or other strings) " "with given expansions/substitutes." + "Replaces acronyms (or other strings) with given expansions/substitutes." ) self.config_dialog = partial(ConfigDialog, self) self.gui_extension_points = { diff --git a/anti_spam/config_dialog.py b/anti_spam/config_dialog.py index dee937f..cc7cb59 100644 --- a/anti_spam/config_dialog.py +++ b/anti_spam/config_dialog.py @@ -45,7 +45,7 @@ class AntiSpamConfigDialog(SettingsDialog): str(max_length), callback=self._on_length_setting, data="msgtxt_limit", - desc=_("Limits maximum message length (leave empty to " "disable)"), + desc=_("Limits maximum message length (leave empty to disable)"), ), Setting( SettingKind.SWITCH, @@ -62,7 +62,7 @@ class AntiSpamConfigDialog(SettingsDialog): self.plugin.config["disable_xhtml_muc"], callback=self._on_setting, data="disable_xhtml_muc", - desc=_("Removes XHTML formatting from group chat " "messages"), + desc=_("Removes XHTML formatting from group chat messages"), ), Setting( SettingKind.SWITCH, @@ -71,9 +71,7 @@ class AntiSpamConfigDialog(SettingsDialog): self.plugin.config["disable_xhtml_pm"], callback=self._on_setting, data="disable_xhtml_pm", - desc=_( - "Removes XHTML formatting from private messages " "in group chats" - ), + desc=_("Removes XHTML formatting from private messages in group chats"), ), Setting( SettingKind.ENTRY, @@ -82,7 +80,7 @@ class AntiSpamConfigDialog(SettingsDialog): self.plugin.config["msgtxt_question"], callback=self._on_setting, data="msgtxt_question", - desc=_("Question has to be answered in order to " "contact you"), + desc=_("Question has to be answered in order to contact you"), ), Setting( SettingKind.ENTRY, @@ -104,7 +102,7 @@ class AntiSpamConfigDialog(SettingsDialog): callback=self._on_setting, data="antispam_for_conference", desc=_( - "Enables anti spam question for private messages " "in group chats" + "Enables anti spam question for private messages in group chats" ), ), ] diff --git a/anti_spam/modules/anti_spam.py b/anti_spam/modules/anti_spam.py index 6245c63..1394bbe 100644 --- a/anti_spam/modules/anti_spam.py +++ b/anti_spam/modules/anti_spam.py @@ -89,20 +89,20 @@ class AntiSpam(BaseModule): limit = cast(int, self._config["msgtxt_limit"]) if limit > 0 and len(msg_body) > limit: self._log.info( - "Discarded message from %s: message " "length exceeded" % msg_from + "Discarded message from %s: message length exceeded" % msg_from ) raise NodeProcessed if self._config["disable_xhtml_muc"] and properties.type.is_groupchat: properties.xhtml = None self._log.info( - "Stripped message from %s: message " "contained XHTML" % msg_from + "Stripped message from %s: message contained XHTML" % msg_from ) if self._config["disable_xhtml_pm"] and properties.is_muc_pm: properties.xhtml = None self._log.info( - "Stripped message from %s: message " "contained XHTML" % msg_from + "Stripped message from %s: message contained XHTML" % msg_from ) def _ask_question(self, properties: MessageProperties) -> bool: diff --git a/message_box_size/msg_box_size.py b/message_box_size/msg_box_size.py index 28a2719..96b3d87 100644 --- a/message_box_size/msg_box_size.py +++ b/message_box_size/msg_box_size.py @@ -30,7 +30,7 @@ from message_box_size.config_dialog import MessageBoxSizeConfigDialog class MsgBoxSizePlugin(GajimPlugin): def init(self) -> None: # pylint: disable=attribute-defined-outside-init - self.description = _("Allows you to adjust the height " "of the message input.") + self.description = _("Allows you to adjust the height of the message input.") self.config_dialog = partial(MessageBoxSizeConfigDialog, self) self.gui_extension_points = { "message_input": (self._on_message_input_created, None) diff --git a/pgp/backend/store.py b/pgp/backend/store.py index 1090c46..7c01d05 100644 --- a/pgp/backend/store.py +++ b/pgp/backend/store.py @@ -50,7 +50,7 @@ class KeyStore: ver = self._store.get("_version", 2) if ver > CURRENT_STORE_VERSION: - raise Exception("Unknown store version! " "Please upgrade pgp plugin.") + raise Exception("Unknown store version! Please upgrade pgp plugin.") elif ver == 2: self._migrate_v2_store() self._save_store() @@ -140,12 +140,12 @@ class KeyStore: return candidates[0] elif len(candidates) > 1: self._log.critical( - "Key collision during migration. " "Key ID is %s. Removing binding...", + "Key collision during migration. Key ID is %s. Removing binding...", repr(short_id), ) else: self._log.warning( - "Key %s was not found during migration. " "Removing binding...", + "Key %s was not found during migration. Removing binding...", repr(short_id), ) raise KeyResolveError diff --git a/pgp/modules/pgp_legacy.py b/pgp/modules/pgp_legacy.py index 0bd3ed4..8c88113 100644 --- a/pgp/modules/pgp_legacy.py +++ b/pgp/modules/pgp_legacy.py @@ -134,13 +134,13 @@ class PGPLegacy(BaseModule): fingerprint = self._pgp.verify(properties.status, properties.signed) if fingerprint is None: self._log.info( - "Presence from %s was signed but no corresponding " "key was found", jid + "Presence from %s was signed but no corresponding key was found", jid ) return self._presence_fingerprint_store[jid] = fingerprint self._log.info( - "Presence from %s was verified successfully, " "fingerprint: %s", + "Presence from %s was verified successfully, fingerprint: %s", jid, fingerprint, ) diff --git a/triggers/gtk/config.py b/triggers/gtk/config.py index 87357c2..71cfc59 100644 --- a/triggers/gtk/config.py +++ b/triggers/gtk/config.py @@ -289,7 +289,7 @@ class ConfigDialog(Gtk.ApplicationWindow): if self._ui.__dict__[st + "_cb"].get_active(): status += get_uf_show(st) + " " model[iter_][1] = _( - "%(event)s (%(recipient_type)s) %(recipient)s " "%(status)s" + "%(event)s (%(recipient_type)s) %(recipient)s %(status)s" ) % { "event": event, "recipient_type": recipient_type,