cq: Format strings
This commit is contained in:
@@ -42,7 +42,7 @@ log = logging.getLogger("gajim.p.acronyms")
|
|||||||
class AcronymsExpanderPlugin(GajimPlugin):
|
class AcronymsExpanderPlugin(GajimPlugin):
|
||||||
def init(self) -> None:
|
def init(self) -> None:
|
||||||
self.description = _(
|
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.config_dialog = partial(ConfigDialog, self)
|
||||||
self.gui_extension_points = {
|
self.gui_extension_points = {
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ class AntiSpamConfigDialog(SettingsDialog):
|
|||||||
str(max_length),
|
str(max_length),
|
||||||
callback=self._on_length_setting,
|
callback=self._on_length_setting,
|
||||||
data="msgtxt_limit",
|
data="msgtxt_limit",
|
||||||
desc=_("Limits maximum message length (leave empty to " "disable)"),
|
desc=_("Limits maximum message length (leave empty to disable)"),
|
||||||
),
|
),
|
||||||
Setting(
|
Setting(
|
||||||
SettingKind.SWITCH,
|
SettingKind.SWITCH,
|
||||||
@@ -62,7 +62,7 @@ class AntiSpamConfigDialog(SettingsDialog):
|
|||||||
self.plugin.config["disable_xhtml_muc"],
|
self.plugin.config["disable_xhtml_muc"],
|
||||||
callback=self._on_setting,
|
callback=self._on_setting,
|
||||||
data="disable_xhtml_muc",
|
data="disable_xhtml_muc",
|
||||||
desc=_("Removes XHTML formatting from group chat " "messages"),
|
desc=_("Removes XHTML formatting from group chat messages"),
|
||||||
),
|
),
|
||||||
Setting(
|
Setting(
|
||||||
SettingKind.SWITCH,
|
SettingKind.SWITCH,
|
||||||
@@ -71,9 +71,7 @@ class AntiSpamConfigDialog(SettingsDialog):
|
|||||||
self.plugin.config["disable_xhtml_pm"],
|
self.plugin.config["disable_xhtml_pm"],
|
||||||
callback=self._on_setting,
|
callback=self._on_setting,
|
||||||
data="disable_xhtml_pm",
|
data="disable_xhtml_pm",
|
||||||
desc=_(
|
desc=_("Removes XHTML formatting from private messages in group chats"),
|
||||||
"Removes XHTML formatting from private messages " "in group chats"
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
Setting(
|
Setting(
|
||||||
SettingKind.ENTRY,
|
SettingKind.ENTRY,
|
||||||
@@ -82,7 +80,7 @@ class AntiSpamConfigDialog(SettingsDialog):
|
|||||||
self.plugin.config["msgtxt_question"],
|
self.plugin.config["msgtxt_question"],
|
||||||
callback=self._on_setting,
|
callback=self._on_setting,
|
||||||
data="msgtxt_question",
|
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(
|
Setting(
|
||||||
SettingKind.ENTRY,
|
SettingKind.ENTRY,
|
||||||
@@ -104,7 +102,7 @@ class AntiSpamConfigDialog(SettingsDialog):
|
|||||||
callback=self._on_setting,
|
callback=self._on_setting,
|
||||||
data="antispam_for_conference",
|
data="antispam_for_conference",
|
||||||
desc=_(
|
desc=_(
|
||||||
"Enables anti spam question for private messages " "in group chats"
|
"Enables anti spam question for private messages in group chats"
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -89,20 +89,20 @@ class AntiSpam(BaseModule):
|
|||||||
limit = cast(int, self._config["msgtxt_limit"])
|
limit = cast(int, self._config["msgtxt_limit"])
|
||||||
if limit > 0 and len(msg_body) > limit:
|
if limit > 0 and len(msg_body) > limit:
|
||||||
self._log.info(
|
self._log.info(
|
||||||
"Discarded message from %s: message " "length exceeded" % msg_from
|
"Discarded message from %s: message length exceeded" % msg_from
|
||||||
)
|
)
|
||||||
raise NodeProcessed
|
raise NodeProcessed
|
||||||
|
|
||||||
if self._config["disable_xhtml_muc"] and properties.type.is_groupchat:
|
if self._config["disable_xhtml_muc"] and properties.type.is_groupchat:
|
||||||
properties.xhtml = None
|
properties.xhtml = None
|
||||||
self._log.info(
|
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:
|
if self._config["disable_xhtml_pm"] and properties.is_muc_pm:
|
||||||
properties.xhtml = None
|
properties.xhtml = None
|
||||||
self._log.info(
|
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:
|
def _ask_question(self, properties: MessageProperties) -> bool:
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ from message_box_size.config_dialog import MessageBoxSizeConfigDialog
|
|||||||
class MsgBoxSizePlugin(GajimPlugin):
|
class MsgBoxSizePlugin(GajimPlugin):
|
||||||
def init(self) -> None:
|
def init(self) -> None:
|
||||||
# pylint: disable=attribute-defined-outside-init
|
# 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.config_dialog = partial(MessageBoxSizeConfigDialog, self)
|
||||||
self.gui_extension_points = {
|
self.gui_extension_points = {
|
||||||
"message_input": (self._on_message_input_created, None)
|
"message_input": (self._on_message_input_created, None)
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ class KeyStore:
|
|||||||
|
|
||||||
ver = self._store.get("_version", 2)
|
ver = self._store.get("_version", 2)
|
||||||
if ver > CURRENT_STORE_VERSION:
|
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:
|
elif ver == 2:
|
||||||
self._migrate_v2_store()
|
self._migrate_v2_store()
|
||||||
self._save_store()
|
self._save_store()
|
||||||
@@ -140,12 +140,12 @@ class KeyStore:
|
|||||||
return candidates[0]
|
return candidates[0]
|
||||||
elif len(candidates) > 1:
|
elif len(candidates) > 1:
|
||||||
self._log.critical(
|
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),
|
repr(short_id),
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
self._log.warning(
|
self._log.warning(
|
||||||
"Key %s was not found during migration. " "Removing binding...",
|
"Key %s was not found during migration. Removing binding...",
|
||||||
repr(short_id),
|
repr(short_id),
|
||||||
)
|
)
|
||||||
raise KeyResolveError
|
raise KeyResolveError
|
||||||
|
|||||||
@@ -134,13 +134,13 @@ class PGPLegacy(BaseModule):
|
|||||||
fingerprint = self._pgp.verify(properties.status, properties.signed)
|
fingerprint = self._pgp.verify(properties.status, properties.signed)
|
||||||
if fingerprint is None:
|
if fingerprint is None:
|
||||||
self._log.info(
|
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
|
return
|
||||||
|
|
||||||
self._presence_fingerprint_store[jid] = fingerprint
|
self._presence_fingerprint_store[jid] = fingerprint
|
||||||
self._log.info(
|
self._log.info(
|
||||||
"Presence from %s was verified successfully, " "fingerprint: %s",
|
"Presence from %s was verified successfully, fingerprint: %s",
|
||||||
jid,
|
jid,
|
||||||
fingerprint,
|
fingerprint,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -289,7 +289,7 @@ class ConfigDialog(Gtk.ApplicationWindow):
|
|||||||
if self._ui.__dict__[st + "_cb"].get_active():
|
if self._ui.__dict__[st + "_cb"].get_active():
|
||||||
status += get_uf_show(st) + " "
|
status += get_uf_show(st) + " "
|
||||||
model[iter_][1] = _(
|
model[iter_][1] = _(
|
||||||
"%(event)s (%(recipient_type)s) %(recipient)s " "%(status)s"
|
"%(event)s (%(recipient_type)s) %(recipient)s %(status)s"
|
||||||
) % {
|
) % {
|
||||||
"event": event,
|
"event": event,
|
||||||
"recipient_type": recipient_type,
|
"recipient_type": recipient_type,
|
||||||
|
|||||||
Reference in New Issue
Block a user