Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions python/raydriver/grbl/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ The central type is GrblSession: it owns the connection lifecycle (handshake, st
"""

import builtins
import collections.abc
import typing
from . import parser
from . import types
Expand Down Expand Up @@ -45,9 +46,9 @@ class GrblSession:
def job_running(self) -> builtins.bool: ...
@property
def resource_uri(self) -> typing.Optional[builtins.str]: ...
def __new__(cls, config: typing.Optional[dict], dialect: typing.Optional[dict] = None, event_callback: typing.Optional[typing.Any] = None) -> GrblSession: ...
def __new__(cls, config: typing.Optional[dict], dialect: typing.Optional[dict] = None, event_callback: typing.Optional[collections.abc.Callable[[SessionEvent], typing.Any]] = None) -> GrblSession: ...
@staticmethod
def with_transport(transport: MockTransport, config: typing.Optional[dict] = None, dialect: typing.Optional[dict] = None, event_callback: typing.Optional[typing.Any] = None) -> GrblSession:
def with_transport(transport: MockTransport, config: typing.Optional[dict] = None, dialect: typing.Optional[dict] = None, event_callback: typing.Optional[collections.abc.Callable[[SessionEvent], typing.Any]] = None) -> GrblSession:
r"""
Build a session around a [`MockTransport`] (for tests).
"""
Expand Down
8 changes: 8 additions & 0 deletions src/python/grbl/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,10 @@ impl GrblSession {
fn new(
config: Option<Bound<'_, PyDict>>,
dialect: Option<Bound<'_, PyDict>>,
#[gen_stub(override_type(
type_repr = "typing.Optional[collections.abc.Callable[[SessionEvent], typing.Any]]",
imports = ("collections.abc", "typing")
))]
event_callback: Option<Py<PyAny>>,
) -> PyResult<Self> {
let kind = transport_kind_from_config(config.as_ref())?;
Expand All @@ -202,6 +206,10 @@ impl GrblSession {
transport: PyRef<'_, MockTransport>,
config: Option<Bound<'_, PyDict>>,
dialect: Option<Bound<'_, PyDict>>,
#[gen_stub(override_type(
type_repr = "typing.Optional[collections.abc.Callable[[SessionEvent], typing.Any]]",
imports = ("collections.abc", "typing")
))]
event_callback: Option<Py<PyAny>>,
) -> PyResult<Self> {
let kind = TransportKind::Mock(transport.inner.clone());
Expand Down
Loading