The default behavior of the subscribe API shares all subscription
requests. API Transports require their own subscription. Add
a method to facilitate this request.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This change refactors the APIDefiniton into a dataclass, allowing
defs to be shared directly among HTTP and RPC requests. In
addition, all transports now share one instance of JSONRPC,
removing duplicate registration. API Defintiions are registered
with the RPC Dispatcher, and it validates the Transport type.
In addition tranports may perform their own validation prior
to request execution.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Refactor endpoint registration to reduce duplicated code.
Rename some APIDefinition attributes for clarity.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Emit a single event where the first argument contains
a "JobEvent" enumeration that describes the particular
event. This reduces the number of callbacks registered
by JobState consumers and allows them react to multiple
state changes in the same callback.
The individual events remain for compatibility, however
they are deprecated. Current modules should be updated
to use the "job_state:state_changed" event and new modules
must use this event.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
These flags replace strings as constants used to register and
identify Request Types (ie: GET, POST) and API Transport
Types.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Some installations do not have Klipper's configuration
in the data path's "config" folder. Provide a way to
opt out of this check.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Use EAFP techniques to test for directory read permission
during registration. If access fails continue with registration.
This allows users to potentially fix an issue without restarting.
Inotify failures always require a restart to resolve.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Introduce placeholders for the regex capture groups.
This reduces the length of the original pattern and
makes it easy to change the pattern for a return value
if necessary.
This change modifies the float pattern to accept any
float or integer.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
When "initial_state" is configured, bound services will be
initialzed based on that state...stopped if the state is
"off", started if its "on.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Correction of the regex (Replacing the = with one: and adding the filament index for the regex to work).
Signed-off-by: Emmanuel WALDNER emmanuel.waldner@gmail.com
Create a websocket endpoint that allows clients identified as
agents to register remote methods with Klipper.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
If the Klipper installation is not updatable (ie not a git repo)
abort reinstantion of the deployer.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Use a lock to guarantee thread safety when parsing data. If
parsing results an error, save the error and raise it.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Use the low level os.open() method to open the vcio device. This
resolves "unknown ioctl" spamming of the kernel log.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
The latest version of several dependencies has deprecated
Python 3.7. Update Moonraker's requirements so that
the latest version is installed without breaking existing
installations.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>