device_proxy_factory package

デバイスクラス名に基づく共通クライアントファクトリ。

device_proxy_factory.DeviceProxy(device_class, *args, **kwargs)[ソース]

登録済み creator を呼び出す。引数は一切解釈せず転送する。

パラメータ:
  • device_class (str)

  • args (Any)

  • kwargs (Any)

戻り値の型:

Any

class device_proxy_factory.DeviceProxyEntry(device_class, creator)[ソース]

ベースクラス: NamedTuple

パラメータ:
  • device_class (str)

  • creator (Callable[[...], Any])

creator: Callable[[...], Any]

Alias for field number 1

device_class: str

Alias for field number 0

device_proxy_factory.create_device_proxy(device_class)[ソース]

デバイスクラス名を固定したローカルファクトリを返す。

パラメータ:

device_class (str)

戻り値の型:

Callable[[...], Any]

device_proxy_factory.get_device_proxy_entry(device_class)[ソース]

登録情報を取得する。未登録の場合は KeyError。

パラメータ:

device_class (str)

戻り値の型:

DeviceProxyEntry

device_proxy_factory.list_device_proxies()[ソース]

登録済みのデバイスクラス名を辞書順で返す。

戻り値の型:

List[str]

device_proxy_factory.make_async_sync_factory(*, async_client_cls=None, sync_client_cls=None, default_async_mode=True)[ソース]

async_mode を解釈する creator を作成する。共通 DeviceProxy は解釈しない。

パラメータ:
  • async_client_cls (Type[Any] | None)

  • sync_client_cls (Type[Any] | None)

  • default_async_mode (bool)

戻り値の型:

Callable[[...], Any]

device_proxy_factory.register_device_proxy(device_class, creator)[ソース]

クラス名と生成処理を登録する。同名の再登録は許可しない。

パラメータ:
  • device_class (str)

  • creator (Callable[[...], Any])

戻り値の型:

None

device_proxy_factory.unregister_device_proxy(device_class)[ソース]

登録を解除する。未登録の場合は KeyError。

パラメータ:

device_class (str)

戻り値の型:

None

Submodules

device_proxy_factory.core module

通信方式に依存しない、デバイスクラス名からのクライアント生成ファクトリ。

device_proxy_factory.core.DeviceProxy(device_class, *args, **kwargs)[ソース]

登録済み creator を呼び出す。引数は一切解釈せず転送する。

パラメータ:
  • device_class (str)

  • args (Any)

  • kwargs (Any)

戻り値の型:

Any

class device_proxy_factory.core.DeviceProxyEntry(device_class, creator)[ソース]

ベースクラス: NamedTuple

パラメータ:
  • device_class (str)

  • creator (Callable[[...], Any])

creator: Callable[[...], Any]

Alias for field number 1

device_class: str

Alias for field number 0

device_proxy_factory.core.create_device_proxy(device_class)[ソース]

デバイスクラス名を固定したローカルファクトリを返す。

パラメータ:

device_class (str)

戻り値の型:

Callable[[...], Any]

device_proxy_factory.core.get_device_proxy_entry(device_class)[ソース]

登録情報を取得する。未登録の場合は KeyError。

パラメータ:

device_class (str)

戻り値の型:

DeviceProxyEntry

device_proxy_factory.core.list_device_proxies()[ソース]

登録済みのデバイスクラス名を辞書順で返す。

戻り値の型:

List[str]

device_proxy_factory.core.register_device_proxy(device_class, creator)[ソース]

クラス名と生成処理を登録する。同名の再登録は許可しない。

パラメータ:
  • device_class (str)

  • creator (Callable[[...], Any])

戻り値の型:

None

device_proxy_factory.core.unregister_device_proxy(device_class)[ソース]

登録を解除する。未登録の場合は KeyError。

パラメータ:

device_class (str)

戻り値の型:

None

device_proxy_factory.factories module

HTTP/gRPC の既存同期・非同期クライアント対に使える補助ファクトリ。

device_proxy_factory.factories.make_async_sync_factory(*, async_client_cls=None, sync_client_cls=None, default_async_mode=True)[ソース]

async_mode を解釈する creator を作成する。共通 DeviceProxy は解釈しない。

パラメータ:
  • async_client_cls (Type[Any] | None)

  • sync_client_cls (Type[Any] | None)

  • default_async_mode (bool)

戻り値の型:

Callable[[...], Any]

device_proxy_factory.typing_generator module

明示的なデバイス型対応表から共通 DeviceProxy のスタブを生成する。

実行時レジストリや通信フレームワークには依存しない。

device_proxy_factory.typing_generator.generate_device_proxy_pyi(devices, output)[ソース]

デバイス名→専用クライアント型の対応を含む core.pyi を生成する。

devices は明示的な辞書の配列。専用クライアントの .pyi はコピーしない。

device_proxy_factory.typing_generator.main()[ソース]