enrobie.utils package#
Submodules#
enrobie.utils.child module#
- exception enrobie.utils.child.InvalidChild(child: str | RobieChild, phase: Literal['initial', 'runtime'], about: str | None = None)[source]#
Bases:
ExceptionException for when the child could not be instantiated.
Note
Similar or identical to classes in other projects.
- Parameters:
child – Name or child that is determined invalid.
phase – From which phase child was found invalid.
about – Additional information for the exception.
enrobie.utils.importer module#
enrobie.utils.param module#
- exception enrobie.utils.param.InvalidParam(error: Literal['minimal', 'invalid', 'missing', 'noexist'], about: str | None = None, *, child: RobieChild | None = None, param: str | None = None, value: Any | None = None)[source]#
Bases:
ExceptionException for after invalid parameters are encountered.
Note
Similar or identical to classes in other projects.
- Parameters:
error – Simple code describing the invalid error.
about – Additional information for the exception.
child – Child class instance related to exception.
param – Name of the parameter which is not valid.
value – Value if any specified for the parameter.
- child: RobieChild | None = None#
enrobie.utils.states module#
- class enrobie.utils.states.ClientChannel[source]#
Bases:
BaseModelCache the information regarding client status on server.
Fields# Field
Type
Required
Default
Constraints
No
Nonemin_length=1
No
Nonemin_length=1
No
Nonemin_length=1
Yes
min_length=1
- unique: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Unique ID of channel on server', metadata=[MinLen(min_length=1)])]#
- title: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Friendly human name of channel', metadata=[MinLen(min_length=1)])]#
- class enrobie.utils.states.ClientChannels[source]#
Bases:
objectCache the information regarding client status on server.
- Parameters:
client – Client class instance for Chatting Robie.
- create(unique: str) None[source]#
Create the channel within the internal cache dictionary.
- Parameters:
unique – Unique identifier for channel on server.
- select(unique: str) ClientChannel | None[source]#
Select the channel within the internal cache dictionary.
- Parameters:
unique – Unique identifier for channel on server.
- Returns:
Channel within the internal cache dictionary.
- delete(unique: str) None[source]#
Delete the channel within the internal cache dictionary.
- Parameters:
unique – Unique identifier for channel on server.
- set_title(unique: str, title: str) None[source]#
Update attribute for channel and create when not exists.
- Parameters:
unique – Unique identifier for channel on server.
title – Proper huamn friendly name of the channel.
- set_topic(unique: str, topic: str) None[source]#
Update attribute for channel and create when not exists.
- Parameters:
unique – Unique identifier for channel on server.
topic – Topic for discussion within the channel.
- add_member(unique: str, member: str) None[source]#
Update attribute for channel and create when not exists.
- Parameters:
unique – Unique identifier for channel on server.
member – Remember relevant to the cache operation.
- del_member(unique: str, member: str) None[source]#
Update attribute for channel and create when not exists.
- Parameters:
unique – Unique identifier for channel on server.
member – Remember relevant to the cache operation.
- class enrobie.utils.states.ClientPublish[source]#
Bases:
objectAllow for subscription to client events useful in tests.
- subscribe(callback: Callable[[RobieMessage], None]) None[source]#
Store the callback within internal subscriber reference.
- Parameters:
callback – Function that will be called with item.
- publish(mitem: RobieMessage) None[source]#
Submit the message from client to subscriber references.
- Parameters:
mitem – Item containing information for operation.
enrobie.utils.thread module#
Module contents#
- exception enrobie.utils.InvalidChild(child: str | RobieChild, phase: Literal['initial', 'runtime'], about: str | None = None)[source]#
Bases:
ExceptionException for when the child could not be instantiated.
Note
Similar or identical to classes in other projects.
- Parameters:
child – Name or child that is determined invalid.
phase – From which phase child was found invalid.
about – Additional information for the exception.
- exception enrobie.utils.InvalidParam(error: Literal['minimal', 'invalid', 'missing', 'noexist'], about: str | None = None, *, child: RobieChild | None = None, param: str | None = None, value: Any | None = None)[source]#
Bases:
ExceptionException for after invalid parameters are encountered.
Note
Similar or identical to classes in other projects.
- Parameters:
error – Simple code describing the invalid error.
about – Additional information for the exception.
child – Child class instance related to exception.
param – Name of the parameter which is not valid.
value – Value if any specified for the parameter.
- child: RobieChild | None = None#
- exception enrobie.utils.DupliThread(thread: str | Thread, about: str | None = None)[source]#
Bases:
ExceptionException for when the client thread is already running.
- Parameters:
thread – Name or thread that would be duplicative.
about – Additional information for the exception.
- class enrobie.utils.ClientChannel[source]#
Bases:
BaseModelCache the information regarding client status on server.
Fields# Field
Type
Required
Default
Constraints
No
Nonemin_length=1
No
Nonemin_length=1
No
Nonemin_length=1
Yes
min_length=1
- unique: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Unique ID of channel on server', metadata=[MinLen(min_length=1)])]#
- title: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Friendly human name of channel', metadata=[MinLen(min_length=1)])]#
- class enrobie.utils.ClientChannels[source]#
Bases:
objectCache the information regarding client status on server.
- Parameters:
client – Client class instance for Chatting Robie.
- create(unique: str) None[source]#
Create the channel within the internal cache dictionary.
- Parameters:
unique – Unique identifier for channel on server.
- select(unique: str) ClientChannel | None[source]#
Select the channel within the internal cache dictionary.
- Parameters:
unique – Unique identifier for channel on server.
- Returns:
Channel within the internal cache dictionary.
- delete(unique: str) None[source]#
Delete the channel within the internal cache dictionary.
- Parameters:
unique – Unique identifier for channel on server.
- set_title(unique: str, title: str) None[source]#
Update attribute for channel and create when not exists.
- Parameters:
unique – Unique identifier for channel on server.
title – Proper huamn friendly name of the channel.
- set_topic(unique: str, topic: str) None[source]#
Update attribute for channel and create when not exists.
- Parameters:
unique – Unique identifier for channel on server.
topic – Topic for discussion within the channel.
- add_member(unique: str, member: str) None[source]#
Update attribute for channel and create when not exists.
- Parameters:
unique – Unique identifier for channel on server.
member – Remember relevant to the cache operation.
- del_member(unique: str, member: str) None[source]#
Update attribute for channel and create when not exists.
- Parameters:
unique – Unique identifier for channel on server.
member – Remember relevant to the cache operation.
- class enrobie.utils.ClientPublish[source]#
Bases:
objectAllow for subscription to client events useful in tests.
- subscribe(callback: Callable[[RobieMessage], None]) None[source]#
Store the callback within internal subscriber reference.
- Parameters:
callback – Function that will be called with item.
- publish(mitem: RobieMessage) None[source]#
Submit the message from client to subscriber references.
- Parameters:
mitem – Item containing information for operation.