From 64a3fb0a48ad6659a28dc9773f95f5e80abd8989 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damir=20Jeli=C4=87?= Date: Wed, 28 Sep 2022 16:32:39 +0200 Subject: [PATCH] chore: Fix a bunch of typos --- README.md | 2 +- docs/man/panctl.1 | 2 +- docs/man/panctl.md | 2 +- docs/man/pantalaimon.5 | 2 +- docs/man/pantalaimon.5.md | 2 +- pantalaimon/client.py | 4 ++-- pantalaimon/config.py | 4 ++-- pantalaimon/daemon.py | 20 ++++++++++---------- pantalaimon/panctl.py | 2 +- pantalaimon/ui.py | 36 ++++++++++++++++++------------------ tests/pan_client_test.py | 8 ++++---- 11 files changed, 42 insertions(+), 42 deletions(-) diff --git a/README.md b/README.md index 9f6b174..47916d8 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ Pantalaimon can also be found on pypi: pip install pantalaimon -Pantalaimon contains a dbus based UI that can be used to controll the daemon. +Pantalaimon contains a dbus based UI that can be used to control the daemon. The dbus based UI is completely optional and needs to be installed with the daemon: diff --git a/docs/man/panctl.1 b/docs/man/panctl.1 index e1ebb8e..705dd97 100644 --- a/docs/man/panctl.1 +++ b/docs/man/panctl.1 @@ -51,7 +51,7 @@ The message will be sent away after all devices are marked as ignored. In contrast to the .Cm send-anyways command this command cancels the sending of a message to an encrypted room with -unverified devices and gives the user the oportunity to verify or blacklist +unverified devices and gives the user the opportunity to verify or blacklist devices as they see fit. .It Cm import-keys Ar pan-user Ar file Ar passphrase Import end-to-end encryption keys from the given file for the given pan-user. diff --git a/docs/man/panctl.md b/docs/man/panctl.md index ed733f5..30fa8f4 100644 --- a/docs/man/panctl.md +++ b/docs/man/panctl.md @@ -74,7 +74,7 @@ are as follows: > In contrast to the > **send-anyways** > command this command cancels the sending of a message to an encrypted room with -> unverified devices and gives the user the oportunity to verify or blacklist +> unverified devices and gives the user the opportunity to verify or blacklist > devices as they see fit. **import-keys** *pan-user* *file* *passphrase* diff --git a/docs/man/pantalaimon.5 b/docs/man/pantalaimon.5 index 62b281e..01fd2d1 100644 --- a/docs/man/pantalaimon.5 +++ b/docs/man/pantalaimon.5 @@ -86,7 +86,7 @@ The amount of time to wait between room message history requests to the Homeserver in ms. Defaults to 3000. .El .Pp -Aditional to the homeserver section a special section with the name +Additional to the homeserver section a special section with the name .Cm Default can be used to configure the following values for all homeservers: .Cm ListenAddress , diff --git a/docs/man/pantalaimon.5.md b/docs/man/pantalaimon.5.md index 4a78e80..60be6f8 100644 --- a/docs/man/pantalaimon.5.md +++ b/docs/man/pantalaimon.5.md @@ -69,7 +69,7 @@ The following keys are optional in the proxy instance sections: > incoming messages will be decryptable, the proxy will be unable to decrypt the > room history. Defaults to "No". -Aditional to the homeserver section a special section with the name +Additional to the homeserver section a special section with the name **Default** can be used to configure the following values for all homeservers: **ListenAddress**, diff --git a/pantalaimon/client.py b/pantalaimon/client.py index e0188f2..5b4ce05 100644 --- a/pantalaimon/client.py +++ b/pantalaimon/client.py @@ -735,7 +735,7 @@ class PanClient(AsyncClient): pass response = ( - f"Succesfully continued the key requests from " + f"Successfully continued the key requests from " f"{message.user_id} via {message.device_id}" ) ret = "m.ok" @@ -760,7 +760,7 @@ class PanClient(AsyncClient): if cancelled: response = ( - f"Succesfully cancelled key requests from " + f"Successfully cancelled key requests from " f"{message.user_id} via {message.device_id}" ) ret = "m.ok" diff --git a/pantalaimon/config.py b/pantalaimon/config.py index 5a5ca4f..8ee51d2 100644 --- a/pantalaimon/config.py +++ b/pantalaimon/config.py @@ -31,7 +31,7 @@ class PanConfigParser(configparser.ConfigParser): "IgnoreVerification": "False", "ListenAddress": "localhost", "ListenPort": "8009", - "LogLevel": "warnig", + "LogLevel": "warning", "Notifications": "on", "UseKeyring": "yes", "SearchRequests": "off", @@ -113,7 +113,7 @@ class ServerConfig: E2E encrypted messages. keyring (bool): Enable or disable the OS keyring for the storage of access tokens. - search_requests (bool): Enable or disable aditional Homeserver requests + search_requests (bool): Enable or disable additional Homeserver requests for the search API endpoint. index_encrypted_only (bool): Enable or disable message indexing fro non-encrypted rooms. diff --git a/pantalaimon/daemon.py b/pantalaimon/daemon.py index e9704d1..3264cab 100755 --- a/pantalaimon/daemon.py +++ b/pantalaimon/daemon.py @@ -227,7 +227,7 @@ class ProxyDaemon: if ret: msg = ( - f"Device {device.id} of user " f"{device.user_id} succesfully verified." + f"Device {device.id} of user " f"{device.user_id} successfully verified." ) await client.send_update_device(device) else: @@ -242,7 +242,7 @@ class ProxyDaemon: if ret: msg = ( f"Device {device.id} of user " - f"{device.user_id} succesfully unverified." + f"{device.user_id} successfully unverified." ) await client.send_update_device(device) else: @@ -257,7 +257,7 @@ class ProxyDaemon: if ret: msg = ( f"Device {device.id} of user " - f"{device.user_id} succesfully blacklisted." + f"{device.user_id} successfully blacklisted." ) await client.send_update_device(device) else: @@ -274,7 +274,7 @@ class ProxyDaemon: if ret: msg = ( f"Device {device.id} of user " - f"{device.user_id} succesfully unblacklisted." + f"{device.user_id} successfully unblacklisted." ) await client.send_update_device(device) else: @@ -358,7 +358,7 @@ class ProxyDaemon: else: info_msg = ( - f"Succesfully exported keys for {client.user_id} " f"to {path}" + f"Successfully exported keys for {client.user_id} " f"to {path}" ) logger.info(info_msg) await self.send_response( @@ -381,7 +381,7 @@ class ProxyDaemon: ) else: info_msg = ( - f"Succesfully imported keys for {client.user_id} " f"from {path}" + f"Successfully imported keys for {client.user_id} " f"from {path}" ) logger.info(info_msg) await self.send_response( @@ -482,7 +482,7 @@ class ProxyDaemon: use_raw_path (str, optional): Should the raw path be used from the request or should we use the path and re-encode it. Some may need their filters to be sanitized, this requires the parsed version of - the path, otherise we leave the path as is. + the path, otherwise we leave the path as is. """ if not session: if not self.default_session: @@ -616,7 +616,7 @@ class ProxyDaemon: await pan_client.close() return - logger.info(f"Succesfully started new background sync client for " f"{user_id}") + logger.info(f"Successfully started new background sync client for " f"{user_id}") await self.send_ui_message( UpdateUsersMessage(self.name, user_id, pan_client.device_id) @@ -682,7 +682,7 @@ class ProxyDaemon: if user_id and access_token: logger.info( - f"User: {user} succesfully logged in, starting " + f"User: {user} successfully logged in, starting " f"a background sync client." ) await self.start_pan_client( @@ -1033,7 +1033,7 @@ class ProxyDaemon: except SendRetryError as e: return web.Response(status=503, text=str(e)) - # Aquire a semaphore here so we only send out one + # Acquire a semaphore here so we only send out one # UnverifiedDevicesSignal sem = client.send_semaphores[room_id] diff --git a/pantalaimon/panctl.py b/pantalaimon/panctl.py index 8652a4c..088bcaa 100644 --- a/pantalaimon/panctl.py +++ b/pantalaimon/panctl.py @@ -464,7 +464,7 @@ class PanCtl: def sas_done(self, pan_user, user_id, device_id, _): print( f"Device {device_id} of user {user_id}" - f" succesfully verified for pan user {pan_user}." + f" successfully verified for pan user {pan_user}." ) def show_sas_invite(self, pan_user, user_id, device_id, _): diff --git a/pantalaimon/ui.py b/pantalaimon/ui.py index cedca65..813b67e 100644 --- a/pantalaimon/ui.py +++ b/pantalaimon/ui.py @@ -470,14 +470,14 @@ if UI_ENABLED: self.bus.publish("org.pantalaimon1", self.control_if, self.device_if) def unverified_notification(self, message): - notificaton = notify2.Notification( + notification = notify2.Notification( "Unverified devices.", message=( f"There are unverified devices in the room " f"{message.room_display_name}." ), ) - notificaton.set_category("im") + notification.set_category("im") def send_cb(notification, action_key, user_data): message = user_data @@ -488,20 +488,20 @@ if UI_ENABLED: self.control_if.CancelSending(message.pan_user, message.room_id) if "actions" in notify2.get_server_caps(): - notificaton.add_action("send", "Send anyways", send_cb, message) - notificaton.add_action("cancel", "Cancel sending", cancel_cb, message) + notification.add_action("send", "Send anyways", send_cb, message) + notification.add_action("cancel", "Cancel sending", cancel_cb, message) - notificaton.show() + notification.show() def sas_invite_notification(self, message): - notificaton = notify2.Notification( + notification = notify2.Notification( "Key verification invite", message=( f"{message.user_id} via {message.device_id} has started " f"a key verification process." ), ) - notificaton.set_category("im") + notification.set_category("im") def accept_cb(notification, action_key, user_data): message = user_data @@ -516,17 +516,17 @@ if UI_ENABLED: ) if "actions" in notify2.get_server_caps(): - notificaton.add_action("accept", "Accept", accept_cb, message) - notificaton.add_action("cancel", "Cancel", cancel_cb, message) + notification.add_action("accept", "Accept", accept_cb, message) + notification.add_action("cancel", "Cancel", cancel_cb, message) - notificaton.show() + notification.show() def sas_show_notification(self, message): emojis = [x[0] for x in message.emoji] emoji_str = " ".join(emojis) - notificaton = notify2.Notification( + notification = notify2.Notification( "Short authentication string", message=( f"Short authentication string for the key verification of" @@ -534,7 +534,7 @@ if UI_ENABLED: f"{emoji_str}" ), ) - notificaton.set_category("im") + notification.set_category("im") def confirm_cb(notification, action_key, user_data): message = user_data @@ -549,21 +549,21 @@ if UI_ENABLED: ) if "actions" in notify2.get_server_caps(): - notificaton.add_action("confirm", "Confirm", confirm_cb, message) - notificaton.add_action("cancel", "Cancel", cancel_cb, message) + notification.add_action("confirm", "Confirm", confirm_cb, message) + notification.add_action("cancel", "Cancel", cancel_cb, message) - notificaton.show() + notification.show() def sas_done_notification(self, message): - notificaton = notify2.Notification( + notification = notify2.Notification( "Device successfully verified.", message=( f"Device {message.device_id} of user {message.user_id} " f"successfully verified." ), ) - notificaton.set_category("im") - notificaton.show() + notification.set_category("im") + notification.show() def message_callback(self): try: diff --git a/tests/pan_client_test.py b/tests/pan_client_test.py index 7202698..5932432 100644 --- a/tests/pan_client_test.py +++ b/tests/pan_client_test.py @@ -28,7 +28,7 @@ ALICE_ID = "@alice:example.org" async def client(tmpdir, loop): store = PanStore(tmpdir) queue = janus.Queue() - conf = ServerConfig("example", "https://exapmle.org") + conf = ServerConfig("example", "https://example.org") conf.history_fetch_delay = 0.1 store.save_server_user("example", "@example:example.org") @@ -421,7 +421,7 @@ class TestClass(object): tasks = client.pan_store.load_fetcher_tasks(client.server_name, client.user_id) assert len(tasks) == 1 - # Check that the task is our prev_batch from the sync resposne + # Check that the task is our prev_batch from the sync response assert tasks[0].room_id == TEST_ROOM_ID assert tasks[0].token == "t392-516_47314_0_7_1_1_1_11444_1" @@ -431,7 +431,7 @@ class TestClass(object): tasks = client.pan_store.load_fetcher_tasks(client.server_name, client.user_id) assert len(tasks) == 1 - # Check that the task is our end token from the messages resposne + # Check that the task is our end token from the messages response assert tasks[0].room_id == TEST_ROOM_ID assert tasks[0].token == "t47409-4357353_219380_26003_2265" @@ -519,7 +519,7 @@ class TestClass(object): ) assert len(tasks) == 1 - # Check that the task is our end token from the messages resposne + # Check that the task is our end token from the messages response assert tasks[0].room_id == TEST_ROOM_ID assert tasks[0].token == "t47409-4357353_219380_26003_2265"