diff --git a/rsbbs/console.py b/rsbbs/console.py index 039a718..0c37bec 100644 --- a/rsbbs/console.py +++ b/rsbbs/console.py @@ -111,13 +111,13 @@ class Console(): datetime = message.Message.datetime.strftime( '%A, %B %-d, %Y at %-H:%M %p UTC') # Print the message - self.write_output(f"") + self.write_output("") self.write_output(f"Message: {message.Message.id}") self.write_output(f"Date: {datetime}") self.write_output(f"From: {message.Message.sender}") self.write_output(f"To: {message.Message.recipient}") self.write_output(f"Subject: {message.Message.subject}") - self.write_output(f"") + self.write_output("") self.write_output(f"{message.Message.message}") def print_message_list(self, messages) -> None: diff --git a/rsbbs/models.py b/rsbbs/models.py index d4a4ce5..059b70d 100644 --- a/rsbbs/models.py +++ b/rsbbs/models.py @@ -22,7 +22,7 @@ from sqlalchemy import Boolean, DateTime, String, Integer,\ Table, ForeignKey, Column from sqlalchemy.orm import DeclarativeBase, Mapped -from sqlalchemy.orm import mapped_column, relationship, backref +from sqlalchemy.orm import mapped_column, relationship class Base(DeclarativeBase): diff --git a/rsbbs/pluginloader.py b/rsbbs/pluginloader.py index c7ffffc..6d271f1 100644 --- a/rsbbs/pluginloader.py +++ b/rsbbs/pluginloader.py @@ -53,7 +53,7 @@ class PluginLoader(): # Add the loaded plugin to the list of plugins self.plugins.append(plugin) - except Exception as e: + except Exception: raise def load_plugins(self) -> None: diff --git a/rsbbs/plugins/delete/plugin.py b/rsbbs/plugins/delete/plugin.py index d6b0290..a7e3269 100644 --- a/rsbbs/plugins/delete/plugin.py +++ b/rsbbs/plugins/delete/plugin.py @@ -62,7 +62,7 @@ class Plugin(): self.api.write_output("A message with that ID addressed " "to you was not found.") except sqlalchemy.exc.NoResultFound: - self.api.write_output(f"Message not found.") + self.api.write_output("Message not found.") except Exception as e: logging.error(e) diff --git a/rsbbs/plugins/deletem/plugin.py b/rsbbs/plugins/deletem/plugin.py index 14b4ae2..cf02afb 100644 --- a/rsbbs/plugins/deletem/plugin.py +++ b/rsbbs/plugins/deletem/plugin.py @@ -53,7 +53,7 @@ class Plugin(): self.api.write_output(f"Deleted {count} messages") logging.info(f"deleted {count} messages") else: - self.api.write_output(f"No messages to delete.") + self.api.write_output("No messages to delete.") except Exception as e: self.api.write_output(f"Unable to delete messages: {e}") diff --git a/rsbbs/plugins/heard/plugin.py b/rsbbs/plugins/heard/plugin.py index c747251..89d19e1 100644 --- a/rsbbs/plugins/heard/plugin.py +++ b/rsbbs/plugins/heard/plugin.py @@ -40,15 +40,15 @@ class Plugin(): """Show a log of stations that have been heard by this station, also known as the 'mheard' (linux) or 'jheard' (KPC, etc.) log. """ - self.api.write_output(f"Heard stations:") + self.api.write_output("Heard stations:") try: result = subprocess.run(['mheard'], capture_output=True, text=True) self.api.write_output(result.stdout) logging.info("queried heard log") except FileNotFoundError: - self.api.write_output(f"mheard utility not found.") - except Exception as e: + self.api.write_output("mheard utility not found.") + except Exception: if self.api.config.debug: raise else: - self.api.write_output(f"Heard stations not available.") + self.api.write_output("Heard stations not available.") diff --git a/rsbbs/plugins/read/plugin.py b/rsbbs/plugins/read/plugin.py index 28a1f9a..336dc51 100644 --- a/rsbbs/plugins/read/plugin.py +++ b/rsbbs/plugins/read/plugin.py @@ -52,14 +52,14 @@ class Plugin(): sqlalchemy.not_(Message.is_private)))) result = session.execute(statement).one() self.api.print_message(result) - logging.info(f"read message") + logging.info("read message") session.commit() user = session.get(User, self.api.user.id) user.messages.append(result[0]) logging.info(f"User {user.id} read message {result[0].id}") session.commit() except sqlalchemy.exc.NoResultFound: - self.api.write_output(f"Message not found.") + self.api.write_output("Message not found.") except Exception as e: logging.error(e) diff --git a/rsbbs/plugins/readm/plugin.py b/rsbbs/plugins/readm/plugin.py index 527d779..35ee2f1 100644 --- a/rsbbs/plugins/readm/plugin.py +++ b/rsbbs/plugins/readm/plugin.py @@ -45,7 +45,7 @@ class Plugin(): result = session.execute( statement, execution_options={"prebuffer_rows": True}) - logging.info(f"read message") + logging.info("read message") return result except Exception: raise @@ -68,4 +68,4 @@ class Plugin(): f"read message {message[0].id }") self.api.read_enter("Enter to continue...") else: - self.api.write_output(f"No messages to read.") + self.api.write_output("No messages to read.") diff --git a/rsbbs/plugins/readnew/plugin.py b/rsbbs/plugins/readnew/plugin.py index 174900e..723bf08 100644 --- a/rsbbs/plugins/readnew/plugin.py +++ b/rsbbs/plugins/readnew/plugin.py @@ -48,7 +48,7 @@ class Plugin(): result = session.execute( statement, execution_options={"prebuffer_rows": True}) - logging.info(f"read message") + logging.info("read message") return result except Exception: raise @@ -71,4 +71,4 @@ class Plugin(): f"read message {message[0].id }") self.api.read_enter("Enter to continue...") else: - self.api.write_output(f"No messages to read.") + self.api.write_output("No messages to read.") diff --git a/rsbbs/plugins/stats/plugin.py b/rsbbs/plugins/stats/plugin.py index f055ae9..3d96223 100644 --- a/rsbbs/plugins/stats/plugin.py +++ b/rsbbs/plugins/stats/plugin.py @@ -77,4 +77,4 @@ class Plugin(): response.append(f"Messages: {self.get_message_count()}") response.append(f"Uptime: {self.get_uptime()}") self.api.write_output('\r\n'.join(response)) - logging.info(f"report stats") + logging.info("report stats") diff --git a/rsbbs/rsbbs.py b/rsbbs/rsbbs.py index 7607599..0e985d2 100755 --- a/rsbbs/rsbbs.py +++ b/rsbbs/rsbbs.py @@ -18,7 +18,6 @@ import logging -from rsbbs import __version__ from rsbbs import Config, Console, Controller, Logger from rsbbs.args import parse_args @@ -38,7 +37,7 @@ def main(): # Start logging logger = Logger(config) - logging.info(f"caller connected") + logging.info("caller connected") # Init the controller controller = Controller(config) diff --git a/rsbbs/user.py b/rsbbs/user.py index 5a3c791..789ec12 100644 --- a/rsbbs/user.py +++ b/rsbbs/user.py @@ -23,9 +23,7 @@ from typing import Any from datetime import datetime, timezone -from rsbbs import __version__ from rsbbs import Config, Controller - from rsbbs.models import User as SAUser @@ -53,14 +51,14 @@ class User(): logging.info(f"User {result[0].callsign} found.") session.commit() else: - logging.info(f"User not found.") + logging.info("User not found.") user = SAUser( callsign=self.callsign, login_count=1, ) session.add(user) session.commit() - logging.info(f"User added.") + logging.info("User added.") return user except Exception as e: logging.error(e) @@ -81,9 +79,9 @@ class User(): user.login_count = user.login_count + 1 user.login_last = datetime.now(timezone.utc) session.commit() - logging.info(f"User updated.") + logging.info("User updated.") else: - logging.info(f"User not found.") + logging.info("User not found.") except Exception as e: logging.error(e) raise