enrobie.utils package#
Subpackages#
Submodules#
enrobie.utils.child module#
Functions and routines associated with Enasis Network Chatting Robie.
This file is part of Enasis Network software eco-system. Distribution is permitted, for more information consult the project license file.
- exception enrobie.utils.child.InvalidChild(child: str | RobieChild, phase: Literal['initial', 'runtime'], about: str | None = None)[source]#
Bases:
Exception
Exception 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#
Functions and routines associated with Enasis Network Chatting Robie.
This file is part of Enasis Network software eco-system. Distribution is permitted, for more information consult the project license file.
enrobie.utils.param module#
Functions and routines associated with Enasis Network Chatting Robie.
This file is part of Enasis Network software eco-system. Distribution is permitted, for more information consult the project license file.
- 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:
Exception
Exception 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 for Chatting Robie.
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#
Functions and routines associated with Enasis Network Chatting Robie.
This file is part of Enasis Network software eco-system. Distribution is permitted, for more information consult the project license file.
- pydantic model enrobie.utils.states.ClientChannel[source]#
Bases:
BaseModel
Cache the information regarding client status on server.
Show JSON schema
{ "title": "ClientChannel", "description": "Cache the information regarding client status on server.", "type": "object", "properties": { "unique": { "description": "Unique ID of channel on server", "minLength": 1, "title": "Unique", "type": "string" }, "title": { "anyOf": [ { "minLength": 1, "type": "string" }, { "type": "null" } ], "default": null, "description": "Friendly human name of channel", "title": "Title" }, "topic": { "anyOf": [ { "minLength": 1, "type": "string" }, { "type": "null" } ], "default": null, "description": "Current topic for the channel", "title": "Topic" }, "members": { "anyOf": [ { "items": { "type": "string" }, "minItems": 1, "type": "array", "uniqueItems": true }, { "type": "null" } ], "default": null, "description": "Current members of the channel", "title": "Members" } }, "additionalProperties": false, "required": [ "unique" ] }
- Config:
extra: str = forbid
- Fields:
- field members: Annotated[set[str] | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Current members of the channel', metadata=[MinLen(min_length=1)])] = None#
Current members of the channel
- Constraints:
min_length = 1
- field title: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Friendly human name of channel', metadata=[MinLen(min_length=1)])] = None#
Friendly human name of channel
- Constraints:
min_length = 1
- class enrobie.utils.states.ClientChannels[source]#
Bases:
object
Cache the information regarding client status on server.
- Parameters:
client – Client class instance for Chatting Robie.
- 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.
- clear_members(unique: str) None [source]#
Update attribute for channel and create when not exists.
- Parameters:
unique – Unique identifier for channel on server.
- create(unique: str) None [source]#
Create the channel within the internal cache dictionary.
- Parameters:
unique – Unique identifier for channel on server.
- 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.
- delete(unique: str) None [source]#
Delete the channel within the internal cache dictionary.
- Parameters:
unique – Unique identifier for channel on server.
- rename_member(current: str, update: str) None [source]#
Update attribute for channel and create when not exists.
- Parameters:
current – Current member name to be be searched.
update – Value to replace current when is found.
- 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.
enrobie.utils.thread module#
Functions and routines associated with Enasis Network Chatting Robie.
This file is part of Enasis Network software eco-system. Distribution is permitted, for more information consult the project license file.
Module contents#
Functions and routines associated with Enasis Network Chatting Robie.
This file is part of Enasis Network software eco-system. Distribution is permitted, for more information consult the project license file.
- pydantic model enrobie.utils.ClientChannel[source]#
Bases:
BaseModel
Cache the information regarding client status on server.
Show JSON schema
{ "title": "ClientChannel", "description": "Cache the information regarding client status on server.", "type": "object", "properties": { "unique": { "description": "Unique ID of channel on server", "minLength": 1, "title": "Unique", "type": "string" }, "title": { "anyOf": [ { "minLength": 1, "type": "string" }, { "type": "null" } ], "default": null, "description": "Friendly human name of channel", "title": "Title" }, "topic": { "anyOf": [ { "minLength": 1, "type": "string" }, { "type": "null" } ], "default": null, "description": "Current topic for the channel", "title": "Topic" }, "members": { "anyOf": [ { "items": { "type": "string" }, "minItems": 1, "type": "array", "uniqueItems": true }, { "type": "null" } ], "default": null, "description": "Current members of the channel", "title": "Members" } }, "additionalProperties": false, "required": [ "unique" ] }
- Config:
extra: str = forbid
- Fields:
- field members: Annotated[set[str] | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Current members of the channel', metadata=[MinLen(min_length=1)])] = None#
Current members of the channel
- Constraints:
min_length = 1
- field title: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Friendly human name of channel', metadata=[MinLen(min_length=1)])] = None#
Friendly human name of channel
- Constraints:
min_length = 1
- class enrobie.utils.ClientChannels[source]#
Bases:
object
Cache the information regarding client status on server.
- Parameters:
client – Client class instance for Chatting Robie.
- 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.
- clear_members(unique: str) None [source]#
Update attribute for channel and create when not exists.
- Parameters:
unique – Unique identifier for channel on server.
- create(unique: str) None [source]#
Create the channel within the internal cache dictionary.
- Parameters:
unique – Unique identifier for channel on server.
- 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.
- delete(unique: str) None [source]#
Delete the channel within the internal cache dictionary.
- Parameters:
unique – Unique identifier for channel on server.
- rename_member(current: str, update: str) None [source]#
Update attribute for channel and create when not exists.
- Parameters:
current – Current member name to be be searched.
update – Value to replace current when is found.
- 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.
- class enrobie.utils.ClientPublish[source]#
Bases:
object
Allow for subscription to client events useful in tests.
- publish(mitem: RobieMessage) None [source]#
Submit the message from client to subscriber references.
- Parameters:
mitem – Item containing information for operation.
- exception enrobie.utils.DupliThread(thread: str | Thread, about: str | None = None)[source]#
Bases:
Exception
Exception for when the client thread is already running.
- Parameters:
thread – Name or thread that would be duplicative.
about – Additional information for the exception.
- exception enrobie.utils.InvalidChild(child: str | RobieChild, phase: Literal['initial', 'runtime'], about: str | None = None)[source]#
Bases:
Exception
Exception 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:
Exception
Exception 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 for Chatting Robie.
param – Name of the parameter which is not valid.
value – Value if any specified for the parameter.
- child: RobieChild | None = None#