From 00720f5bf09c0c719d0dbfdbdc73e332f6268853 Mon Sep 17 00:00:00 2001 From: Thijs Triemstra Date: Sat, 26 Jul 2025 20:03:29 +0200 Subject: [PATCH] moonraker: fix typos in source Signed-off-by: Thijs Triemstra --- moonraker/common.py | 4 ++-- moonraker/components/application.py | 2 +- moonraker/components/database.py | 2 +- moonraker/components/dbus_manager.py | 2 +- .../components/file_manager/file_manager.py | 22 +++++++++---------- moonraker/components/file_manager/metadata.py | 2 +- moonraker/components/history.py | 2 +- moonraker/components/klippy_apis.py | 4 ++-- moonraker/components/klippy_connection.py | 2 +- moonraker/components/machine.py | 2 +- moonraker/components/paneldue.py | 2 +- moonraker/components/power.py | 6 ++--- moonraker/components/simplyprint.py | 6 ++--- .../update_manager/python_deploy.py | 14 ++++++------ .../update_manager/system_deploy.py | 2 +- .../update_manager/update_manager.py | 6 ++--- moonraker/components/wled.py | 2 +- moonraker/confighelper.py | 2 +- moonraker/eventloop.py | 2 +- moonraker/utils/__init__.py | 2 +- moonraker/utils/filelock.py | 2 +- moonraker/utils/ioctl_macros.py | 2 +- moonraker/utils/sysdeps_parser.py | 4 ++-- moonraker/utils/sysfs_devs.py | 4 ++-- 24 files changed, 50 insertions(+), 50 deletions(-) diff --git a/moonraker/common.py b/moonraker/common.py index b467b98..6b54780 100644 --- a/moonraker/common.py +++ b/moonraker/common.py @@ -588,7 +588,7 @@ class WebRequest: except Exception: raise ServerError( f"Unable to convert argument [{key}] to {dtype}: " - f"value recieved: {val}") + f"value received: {val}") def get(self, key: str, @@ -892,7 +892,7 @@ class JsonRPC: } -# *** Job History Common Clases *** +# *** Job History Common Classes *** class FieldTracker(Generic[_T]): history: History = None # type: ignore diff --git a/moonraker/components/application.py b/moonraker/components/application.py index 6b3ebad..bc46864 100644 --- a/moonraker/components/application.py +++ b/moonraker/components/application.py @@ -764,7 +764,7 @@ class RPCHandler(AuthorizedRequestHandler, APITransport): class FileRequestHandler(AuthorizedFileHandler): def set_extra_headers(self, path: str) -> None: - # The call below shold never return an empty string, + # The call below should never return an empty string, # as the path should have already been validated to be # a file assert isinstance(self.absolute_path, str) diff --git a/moonraker/components/database.py b/moonraker/components/database.py index ced670e..74ba38d 100644 --- a/moonraker/components/database.py +++ b/moonraker/components/database.py @@ -1312,7 +1312,7 @@ class SqliteProvider(Thread): ) elif detected_proto != table_def.prototype: self.server.add_warning( - f"Table '{table_def.name}' defintion does not match stored " + f"Table '{table_def.name}' definition does not match stored " "definition. See the log for details." ) logging.info( diff --git a/moonraker/components/dbus_manager.py b/moonraker/components/dbus_manager.py index dffe672..6a2b7b1 100644 --- a/moonraker/components/dbus_manager.py +++ b/moonraker/components/dbus_manager.py @@ -130,7 +130,7 @@ class DbusManager: interface_names: List[str] ) -> List[ProxyInterface]: if self.bus is None: - raise self.server.error("Bus not avaialable") + raise self.server.error("Bus not available") interfaces: List[ProxyInterface] = [] introspection = await self.bus.introspect(bus_name, bus_path) proxy_obj = self.bus.get_proxy_object(bus_name, bus_path, diff --git a/moonraker/components/file_manager/file_manager.py b/moonraker/components/file_manager/file_manager.py index 758c994..6fe3ce3 100644 --- a/moonraker/components/file_manager/file_manager.py +++ b/moonraker/components/file_manager/file_manager.py @@ -139,7 +139,7 @@ class FileManager: "/server/files/delete_file", RequestType.DELETE, self._handle_file_delete, transports=TransportType.WEBSOCKET ) - # register client notificaitons + # register client notifications self.server.register_notification("file_manager:filelist_changed") self.server.register_event_handler( @@ -846,7 +846,7 @@ class FileManager: ) -> Dict[str, Any]: if 'filename' not in upload_args: raise self.server.error( - "No file name specifed in upload form") + "No file name specified in upload form") # check relative path root: str = upload_args.get('root', "gcodes").lower() if root not in self.file_paths: @@ -993,8 +993,8 @@ class FileManager: visited_dirs = {(st.st_dev, st.st_ino)} for dir_path, dir_names, files in os.walk(path, followlinks=True): scan_dirs: List[str] = [] - # Filter out directories that have already been visted. This - # prevents infinite recrusion "followlinks" is set to True + # Filter out directories that have already been visited. This + # prevents infinite recursion "followlinks" is set to True for dname in dir_names: full_path = os.path.join(dir_path, dname) if not os.path.exists(full_path): @@ -1181,7 +1181,7 @@ class NotifySyncLock(asyncio.Lock): current_path = pathlib.Path(current_path) self.dest_path = current_path if current_path in self.acquired_paths: - # Notifcation has been recieved, no need to wait + # Notification has been received, no need to wait return self.move_copy_fut = self.server.get_event_loop().create_future() mcfut = self.move_copy_fut @@ -1250,7 +1250,7 @@ class NotifySyncLock(asyncio.Lock): waiter: Optional[asyncio.Future] = None if self.check_pending: # The final path of move/copy requests aren't known until the request - # complete. It may be the destination path recieved from the request + # complete. It may be the destination path received from the request # or it may be a child as of that path. if self.move_copy_fut is not None: # Request is complete, metadata analysis pending. We can explicitly @@ -1384,8 +1384,8 @@ class BaseFileSystemObserver: visited_dirs = {(st.st_dev, st.st_ino)} for parent, dirs, files in os.walk(start_path, followlinks=True): scan_dirs: List[str] = [] - # Filter out directories that have already been visted. This - # prevents infinite recrusion "followlinks" is set to True + # Filter out directories that have already been visited. This + # prevents infinite recursion "followlinks" is set to True parent_dir = pathlib.Path(parent) for dname in dirs: dir_path = parent_dir.joinpath(dname) @@ -1516,7 +1516,7 @@ class InotifyNode: def _finish_delete_child(self) -> None: # Items deleted in a child (node or file) are batched. # Individual files get notifications if their parent - # node stil exists. Otherwise notififications are + # node still exists. Otherwise notififications are # bundled into the topmost deleted parent. if "delete_child" not in self.pending_node_events: self.pending_deleted_children.clear() @@ -1858,7 +1858,7 @@ class InotifyObserver(BaseFileSystemObserver): return None def add_root_watch(self, root: str, root_path: str) -> None: - # remove all exisiting watches on root + # remove all existing watches on root if root in self.watched_roots: old_root = self.watched_roots.pop(root) old_root.clear_watches() @@ -2582,7 +2582,7 @@ class MetadataStorage: } self.mddb[fname] = self.metadata[fname] logging.info( - f"Unable to extract medatadata from file: {fname}") + f"Unable to extract metadata from file: {fname}") self.pending_requests.pop(fname, None) mevt.set() self.busy = False diff --git a/moonraker/components/file_manager/metadata.py b/moonraker/components/file_manager/metadata.py index 3453e17..d06f060 100644 --- a/moonraker/components/file_manager/metadata.py +++ b/moonraker/components/file_manager/metadata.py @@ -1316,7 +1316,7 @@ if __name__ == "__main__": ) parser.add_argument( "-o", "--check-objects", dest='check_objects', action='store_true', - help="process gcode file for exclude opbject functionality") + help="process gcode file for exclude object functionality") args = parser.parse_args() config: Dict[str, Any] = {} if args.config is None: diff --git a/moonraker/components/history.py b/moonraker/components/history.py index 66a8ab4..1d516ed 100644 --- a/moonraker/components/history.py +++ b/moonraker/components/history.py @@ -247,7 +247,7 @@ class History: item = dict(row) item.pop("instance_id", None) self.aux_totals.append(item) - # Check for interupted jobs + # Check for interrupted jobs cursor = await self.history_table.execute( f"SELECT job_id FROM {HIST_TABLE} WHERE status = 'in_progress'" ) diff --git a/moonraker/components/klippy_apis.py b/moonraker/components/klippy_apis.py index b7a869b..96c194c 100644 --- a/moonraker/components/klippy_apis.py +++ b/moonraker/components/klippy_apis.py @@ -133,7 +133,7 @@ class KlippyAPI(APITransport): # WARNING: Do not call this method from within the following # event handlers when "wait_klippy_started" is set to True: # klippy_identified, klippy_started, klippy_ready, klippy_disconnect - # Doing so will result in "wait_started" blocking for the specifed + # Doing so will result in "wait_started" blocking for the specified # timeout (default 20s) and returning False. # XXX - validate that file is on disk if filename[0] == '/': @@ -178,7 +178,7 @@ class KlippyAPI(APITransport): # WARNING: Do not call this method from within the following # event handlers when "wait_klippy_started" is set to True: # klippy_identified, klippy_started, klippy_ready, klippy_disconnect - # Doing so will result in "wait_started" blocking for the specifed + # Doing so will result in "wait_started" blocking for the specified # timeout (default 20s) and returning False. if wait_klippy_started: await self.klippy.wait_started() diff --git a/moonraker/components/klippy_connection.py b/moonraker/components/klippy_connection.py index 565cd60..9e625c2 100644 --- a/moonraker/components/klippy_connection.py +++ b/moonraker/components/klippy_connection.py @@ -93,7 +93,7 @@ class KlippyConnection: self._state.set_message("Klippy Disconnected") self.subscriptions: Dict[APITransport, Subscription] = {} self.subscription_cache: Dict[str, Dict[str, Any]] = {} - # Setup remote methods accessable to Klippy. Note that all + # Setup remote methods accessible to Klippy. Note that all # registered remote methods should be of the notification type, # they do not return a response to Klippy after execution self.pending_requests: Dict[int, KlippyRequest] = {} diff --git a/moonraker/components/machine.py b/moonraker/components/machine.py index a0689df..f9acfbd 100644 --- a/moonraker/components/machine.py +++ b/moonraker/components/machine.py @@ -1195,7 +1195,7 @@ class SystemdDbusProvider(BaseProvider): "sessions are open." ) try: - # Get the login manaager interface + # Get the login manager interface self.login_mgr = await self.dbus_mgr.get_interface( "org.freedesktop.login1", "/org/freedesktop/login1", diff --git a/moonraker/components/paneldue.py b/moonraker/components/paneldue.py index 0612bd2..267f2f1 100644 --- a/moonraker/components/paneldue.py +++ b/moonraker/components/paneldue.py @@ -110,7 +110,7 @@ class PanelDue: ) self.server.register_remote_method("paneldue_beep", self.paneldue_beep) - # These commands are directly executued on the server and do not to + # These commands are directly executed on the server and do not to # make a request to Klippy self.direct_gcodes: Dict[str, FlexCallback] = { 'M20': self._run_paneldue_M20, diff --git a/moonraker/components/power.py b/moonraker/components/power.py index cd32306..24516d9 100644 --- a/moonraker/components/power.py +++ b/moonraker/components/power.py @@ -417,7 +417,7 @@ class PowerDevice: except asyncio.CancelledError: raise except Exception: - logging.info(f"Power Device {self.name}: Error setting intitial state") + logging.info(f"Power Device {self.name}: Error setting initial state") async def process_request(self, req: str, force: bool = False) -> str: if self.state == "init" and self.request_lock.locked(): @@ -613,7 +613,7 @@ class HTTPDevice(PowerDevice): except Exception: self.state = "error" if self._should_log_error(): - logging.exception(f"Error Refeshing Device Status: {self.name}") + logging.exception(f"Error Refreshing Device Status: {self.name}") else: self.state = state @@ -1035,7 +1035,7 @@ class TPLinkSmartPlug(PowerDevice): except Exception: self.state = "error" if self._should_log_error(): - logging.exception(f"Error Refeshing Device Status: {self.name}") + logging.exception(f"Error Refreshing Device Status: {self.name}") else: self.state = "on" if state else "off" diff --git a/moonraker/components/simplyprint.py b/moonraker/components/simplyprint.py index 16142c7..c4b10bc 100644 --- a/moonraker/components/simplyprint.py +++ b/moonraker/components/simplyprint.py @@ -668,7 +668,7 @@ class SimplyPrint(APITransport): new_stats: Dict[str, Any], need_start_event: bool = True ) -> None: - # inlcludes started and resumed events + # includes started and resumed events self._update_state("printing") filename = new_stats["filename"] job_info: Dict[str, Any] = {"filename": filename} @@ -1362,7 +1362,7 @@ class WebcamStream: try: url = await cam.get_snapshot_url(True) except Exception: - logging.exception("Failed to retrive webcam url") + logging.exception("Failed to retrieve webcam url") return self.cam = cam logging.info(f"SimplyPrint Webcam URL assigned: {url}") @@ -1481,7 +1481,7 @@ class PrintHandler: filename = pathlib.PurePath(tmp_path.name) fpath = gc_path.joinpath(filename.name) if self.cache.job_info.get("filename", "") == str(fpath): - # This is an attempt to overwite a print in progress, make a copy + # This is an attempt to overwrite a print in progress, make a copy count = 0 while fpath.exists(): name = f"{filename.stem}_copy_{count}.{filename.suffix}" diff --git a/moonraker/components/update_manager/python_deploy.py b/moonraker/components/update_manager/python_deploy.py index a7b1d6f..0c278f1 100644 --- a/moonraker/components/update_manager/python_deploy.py +++ b/moonraker/components/update_manager/python_deploy.py @@ -137,7 +137,7 @@ class PythonDeploy(AppDeploy): self.current_sha = vcs_info["commit_id"] self.repo_url = direct_url_data["url"] except KeyError: - self._add_warning("Failed to retrive direct_url vcs info") + self._add_warning("Failed to retrieve direct_url vcs info") return if not self._match_repo_url(): self._add_warning(f"Invalid repo url: {self.repo_url}") @@ -177,20 +177,20 @@ class PythonDeploy(AppDeploy): return "" def _update_current_version(self, package_info: PackageInfo) -> bool: - pkg_verson = "" + pkg_version = "" release_info = package_info.release_info metadata = package_info.metadata if release_info is not None: if self.current_sha == "?": self.current_sha = release_info.get("commit_sha", "?") self.git_version = GitVersion(release_info.get("git_version", "?")) - pkg_verson = release_info.get("package_version", "") + pkg_version = release_info.get("package_version", "") if "Version" in metadata: - pkg_verson = metadata["Version"] - if not pkg_verson: + pkg_version = metadata["Version"] + if not pkg_version: self._add_warning("Failed to detect package version") return False - self.current_version = PyVersion(pkg_verson) + self.current_version = PyVersion(pkg_version) if not self.current_version.is_valid_version(): self._add_warning("Failed to parse package version") return False @@ -250,7 +250,7 @@ class PythonDeploy(AppDeploy): async def _refresh_pip(self) -> None: # Perform a dry-run install to see if an update is available. - # Curently this is the most reliable way to fetch the latest + # Currently this is the most reliable way to fetch the latest # version from an index, as we can't assume configurations # will use PyPI. self.log_info("Requesting package info via PIP...") diff --git a/moonraker/components/update_manager/system_deploy.py b/moonraker/components/update_manager/system_deploy.py index 223a6f6..4354ec7 100644 --- a/moonraker/components/update_manager/system_deploy.py +++ b/moonraker/components/update_manager/system_deploy.py @@ -245,7 +245,7 @@ class PackageKitProvider(BasePackageProvider): "org.freedesktop.packagekit.system-update", "The Update Manager will fail to update packages" ) - # Fetch the PackageKit DBus Inteface + # Fetch the PackageKit DBus Interface self.pkgkit = await self.dbus_mgr.get_interface( "org.freedesktop.PackageKit", "/org/freedesktop/PackageKit", diff --git a/moonraker/components/update_manager/update_manager.py b/moonraker/components/update_manager/update_manager.py index 533a291..cd580c9 100644 --- a/moonraker/components/update_manager/update_manager.py +++ b/moonraker/components/update_manager/update_manager.py @@ -480,7 +480,7 @@ class UpdateManager: if updater is None: raise self.server.error(f"Updater {app} not available", 404) elif not isinstance(updater, GitDeploy): - raise self.server.error(f"Upater {app} is not a Git Repo Type") + raise self.server.error(f"Updater {app} is not a Git Repo Type") async with self.cmd_request_lock: self.cmd_helper.set_update_info(f"recover_{app}", id(web_request)) try: @@ -544,9 +544,9 @@ class CommandHelper: self.umdb = db.wrap_namespace("update_manager") # Refresh Time Tracking (default is to refresh every 7 days) - reresh_interval = config.getint('refresh_interval', 168) + refresh_interval = config.getint('refresh_interval', 168) # Convert to seconds - self.refresh_interval = reresh_interval * 60 * 60 + self.refresh_interval = refresh_interval * 60 * 60 # GitHub API Rate Limit Tracking self.gh_rate_limit: Optional[int] = None diff --git a/moonraker/components/wled.py b/moonraker/components/wled.py index ae7fd6c..9ccaea0 100644 --- a/moonraker/components/wled.py +++ b/moonraker/components/wled.py @@ -335,7 +335,7 @@ class StripSerial(Strip): try: data = jsonw.loads(line.strip()) except jsonw.JSONDecodeError: - logging.debug(f"Recieved Serial Data: {line!r}") + logging.debug(f"Received Serial Data: {line!r}") else: if ( self.pending_response is not None and diff --git a/moonraker/confighelper.py b/moonraker/confighelper.py index a68a0c1..c4173b8 100644 --- a/moonraker/confighelper.py +++ b/moonraker/confighelper.py @@ -158,7 +158,7 @@ class ConfigHelper: if deprecate: self.server.add_warning( f"[{self.section}]: Option '{option}' is " - "deprecated, see the configuration documention " + "deprecated, see the configuration documentation " f"at {DOCS_URL}/configuration/") if warn_fallback: help = f"{DOCS_URL}/configuration/#option-moved-deprecations" diff --git a/moonraker/eventloop.py b/moonraker/eventloop.py index 5943ccd..d97d6fa 100644 --- a/moonraker/eventloop.py +++ b/moonraker/eventloop.py @@ -77,7 +77,7 @@ class EventLoop: if not new_loop.is_closed(): break logging.info("Failed to create open eventloop, " - "retyring in .5 seconds...") + "retrying in .5 seconds...") time.sleep(.5) else: raise RuntimeError("Unable to create new open eventloop") diff --git a/moonraker/utils/__init__.py b/moonraker/utils/__init__.py index 0a9c21f..c182b13 100644 --- a/moonraker/utils/__init__.py +++ b/moonraker/utils/__init__.py @@ -136,7 +136,7 @@ def get_repo_info(source_path: str) -> Dict[str, Any]: comp = parts[1].split("/", maxsplit=1)[-1] repo_info["unofficial_components"].append(comp) except Exception: - logging.exception("Error Retreiving Git Repo Info") + logging.exception("Error Retrieving Git Repo Info") return repo_info def get_software_info() -> Dict[str, Any]: diff --git a/moonraker/utils/filelock.py b/moonraker/utils/filelock.py index 32fd391..3b6a648 100644 --- a/moonraker/utils/filelock.py +++ b/moonraker/utils/filelock.py @@ -74,7 +74,7 @@ class AsyncExclusiveFileLock(contextlib.AbstractAsyncContextManager): self.locked = await loop.run_in_executor(None, self._get_lock) except OSError as err: logging.info( - "Failed to aquire advisory lock, allowing unlocked entry." + "Failed to acquire advisory lock, allowing unlocked entry." f"Error: {err}" ) self.locked = False diff --git a/moonraker/utils/ioctl_macros.py b/moonraker/utils/ioctl_macros.py index 08ccbb7..8d4bc7a 100644 --- a/moonraker/utils/ioctl_macros.py +++ b/moonraker/utils/ioctl_macros.py @@ -9,7 +9,7 @@ import ctypes from typing import Union, Type, TYPE_CHECKING """ -This module contains of Python port of the macros avaialble in +This module contains a Python port of the macros available in "/include/uapi/asm-generic/ioctl.h" from the linux kernel. """ diff --git a/moonraker/utils/sysdeps_parser.py b/moonraker/utils/sysdeps_parser.py index 4b31bc6..b25f45d 100644 --- a/moonraker/utils/sysdeps_parser.py +++ b/moonraker/utils/sysdeps_parser.py @@ -15,7 +15,7 @@ def _get_distro_info() -> Dict[str, Any]: try: # try importing the distro module first. It can detect # old/obscure releases that do not have the standard - # os-release fle. + # os-release file. import distro except ModuleNotFoundError: pass @@ -99,7 +99,7 @@ class SysDepsParser: continue elif last_logical_op is None: logging.info( - f"Requirement specifier contains two seqential expressions " + f"Requirement specifier contains two sequential expressions " f"without a logical operator: {full_spec}") return None dep_parts = re.split(r"(==|!=|<=|>=|<|>)", exp.strip()) diff --git a/moonraker/utils/sysfs_devs.py b/moonraker/utils/sysfs_devs.py index 4f906cb..8764c57 100644 --- a/moonraker/utils/sysfs_devs.py +++ b/moonraker/utils/sysfs_devs.py @@ -411,8 +411,8 @@ def find_video_devices() -> List[Dict[str, Any]]: for v4ldev_path in v4lpath.iterdir(): devfs_name = v4ldev_path.name devfs_path = dev_root_folder.joinpath(devfs_name) - # The video4linux sysfs implmentation provides limited device - # info. Use the VIDEOC_QUERYCAPS ioctl to retreive extended + # The video4linux sysfs implementation provides limited device + # info. Use the VIDEOC_QUERYCAPS ioctl to retrieve extended # information about the v4l2 device. fd: int = -1 try: