This method is now the primary means of deleting files, as it includes checks to make sure that the delete is allowed.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Websocket APIs are now generated using traditional namespaces, for example "printer.gcode.script" rather than "post_printer_gcode_script". Local endpoints that register multiple requests methods will have the method prefixed (ie:. "server.files.get_directory", "server.files.post_directory", "server.files.delete_directory")
Signed-off-by: Eric Callahan
If the metadata script encoutners an error it will return an empty dict for the "metadata" item. Do not update the metadata storage or send a notification if the dict is empty.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Attempt to reconnect every 250ms when disconnected. Once connected, attempt to initialize every 250ms.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Move logic for managine metadata to its own class. Allow 3 retries if extraction fails, and send a printer event if metadata is updated due to an added file.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Logging to a file has the potential to block a the main thread, a QueueLogger resolves this by forwarding logging request to a secondary thread.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This optimized version should initialize faster as it doesn't rely on an additional Periodic Callback when Klippy is detected as ready.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Like gcode_apis, the klippy_apis module registers Web API aliases for particular gcodes. In addition, this module presents an interface where moonraker can call Klippy APIs directly.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This allows users to specify a "confirmed_macros" that wil pop up a message box requiring confirmation before proceeding. Useful for restart and firmware_restart to prevent accidental execution.
Also do not raise an exception when Klippy disconnects after a restart or firmware_restart.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
The make_request() method is now awaitable and returns the result directly vs the previous behavior of returning a request that was awaited.
There is no longer a need to check the result to see if it is an error, exceptions are raised if an error is detected.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
It is expected that the Klippy will disconnect when a restart request is sent. Handle those exceptions so they return an acknowledgement.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>