moonraker: fix typos in source
Signed-off-by: Thijs Triemstra <info@collab.nl>
This commit is contained in:
1 parent
46913913be
commit
00720f5bf0
24 files changed
+50
-50
No files matched your search
+2
-2
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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'"
|
||||
)
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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] = {}
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
@@ -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}"
|
||||
|
||||
@@ -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...")
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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]:
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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.
|
||||
"""
|
||||
|
||||
|
||||
@@ -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())
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in new issue
Block a user