cq: Format strings

This commit is contained in:
Philipp Hörist
2025-01-25 20:56:23 +01:00
parent 223328587f
commit 7b8fa3c432
7 changed files with 16 additions and 18 deletions

View File

@@ -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 = {

View File

@@ -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"
),
),
]

View File

@@ -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:

View File

@@ -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)

View File

@@ -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

View File

@@ -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,
)

View File

@@ -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,