-
-
Notifications
You must be signed in to change notification settings - Fork 0
Complete Python docstrings for all /src/*.py modules #36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -74,6 +74,9 @@ def set_properties(self): | |||||
|
|
||||||
| def iterate(self): | ||||||
| """ Recursive iterate through hierarchical class instances. | ||||||
|
|
||||||
| :return: generator yielding class instances in hierarchy | ||||||
| :rtype: generator | ||||||
| """ | ||||||
| yield self | ||||||
| for x in self: | ||||||
|
|
@@ -172,6 +175,11 @@ def property_dict(self): | |||||
| """ property_dict() method. | ||||||
|
|
||||||
| Return all classes self._SYSProperties property_id, value dictionary. | ||||||
|
|
||||||
| :return: dictionary of all properties excluding 'SYSServiceMethod' | ||||||
| :rtype: dict | ||||||
|
|
||||||
| Decorated with @property so direct property access possible | ||||||
| """ | ||||||
|
|
||||||
| return_dict = {} | ||||||
|
|
@@ -203,7 +211,12 @@ def class_name(self): | |||||
| return self.__class__.__name__ | ||||||
|
|
||||||
| def get_value_by_property_id(self, property_id): | ||||||
| """ get_value_by_property_id() method.""" | ||||||
| """ get_value_by_property_id() method. | ||||||
|
|
||||||
| :param str property_id: property identifier | ||||||
| :return: attribute value for given property_id | ||||||
| :rtype: dynamic | ||||||
|
||||||
| """ | ||||||
| return getattr(self, property_id) | ||||||
|
|
||||||
|
|
||||||
|
|
@@ -214,6 +227,7 @@ class ClassHandler(BaseHandler): | |||||
| def __init__(self): | ||||||
| """ | ||||||
| :ivar str _SYSType: const internal system type to differentiate handler types | ||||||
| :ivar classref _ServiceRouter: ServiceRouter instance reference | ||||||
|
||||||
| :ivar classref _ServiceRouter: ServiceRouter instance reference | |
| :ivar ServiceRouter _ServiceRouter: ServiceRouter instance reference |
Copilot
AI
Jan 13, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The type annotation 'classref' is not a valid Python type. The standard Python type for class or instance references would be 'type', 'Type' from the typing module, or the actual class name. Consider using the specific class name or 'object' for instance references.
Copilot
AI
Jan 13, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The type annotation 'classref' is not a valid Python type. Consider using the specific class name (e.g., 'ClassMapper') or 'object' for instance references.
Copilot
AI
Jan 13, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The type annotation 'classref' is not a valid Python type. Consider using the specific class name (e.g., 'ClassMapper') or 'object' for instance references.
Copilot
AI
Jan 13, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The type annotation 'classref' is not a valid Python type. Consider using the specific class name (e.g., 'ClassMapper') or 'object' for instance references.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,17 +20,20 @@ | |
|
|
||
| class ServiceRouter(): | ||
| """ ServiceRouter class. | ||
|
|
||
| Provides routing functionality to user-defined service methods in user_routing module. | ||
| """ | ||
|
|
||
| def send(self, send_id, metadata): | ||
| """ send() method. | ||
|
|
||
| :param str send_id: service method id | ||
| :param dynamic metadata: first argument passed to service method function | ||
| :rtype: dict | None | ||
|
|
||
| Execute method with given id in `send_id` from imported user_routing.py module | ||
| and return result dict or None. | ||
|
|
||
| :param str send_id: service method id (function name in user_routing module) | ||
| :param dynamic metadata: first argument passed to service method function | ||
|
||
| :return: result from user routing function | ||
| :rtype: dict | None | ||
| """ | ||
| logger.debug('ServiceRouter send_id:{} metadata:{}'.format(send_id, metadata)) | ||
| func_ref = getattr(mod_ref, send_id) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,43 +1,93 @@ | ||
| # ]*[ --------------------------------------------------------------------- ]*[ | ||
| # . Micro ESB Test Classes Module . | ||
| # ]*[ --------------------------------------------------------------------- ]*[ | ||
| # . . | ||
| # . Copyright Claus Prüfer (2016 - 2026) . | ||
| # . . | ||
| # . . | ||
| # ]*[ --------------------------------------------------------------------- ]*[ | ||
|
|
||
| from microesb import microesb | ||
|
|
||
|
|
||
| class Cert(microesb.ClassHandler): | ||
| """ Certificate handler class. | ||
|
|
||
| Base class for certificate types (CA, Server, Client). | ||
| """ | ||
| pass | ||
|
|
||
|
|
||
| class CertCA(Cert): | ||
| """ Certificate Authority handler class. | ||
|
|
||
| Handles CA certificate instances. | ||
| """ | ||
| def __init__(self): | ||
| """ | ||
| :ivar str type: certificate type identifier | ||
| """ | ||
| self.type = 'ca' | ||
| super().__init__() | ||
|
|
||
|
|
||
| class CertServer(Cert): | ||
| """ Server certificate handler class. | ||
|
|
||
| Handles server certificate instances. | ||
| """ | ||
| def __init__(self): | ||
| """ | ||
| :ivar str type: certificate type identifier | ||
| """ | ||
| self.type = 'server' | ||
| super().__init__() | ||
|
|
||
|
|
||
| class CertClient(Cert): | ||
| """ Client certificate handler class. | ||
|
|
||
| Handles client certificate instances. | ||
| """ | ||
| def __init__(self): | ||
| """ | ||
| :ivar str type: certificate type identifier | ||
| """ | ||
| self.type = 'client' | ||
| super().__init__() | ||
|
|
||
|
|
||
| class Smartcard(microesb.ClassHandler): | ||
| """ Smartcard handler class. | ||
|
|
||
| Handles smartcard instances for certificate storage. | ||
| """ | ||
| def __init__(self): | ||
| super().__init__() | ||
|
|
||
|
|
||
| class SmartcardContainer(microesb.ClassHandler): | ||
| """ Smartcard container handler class. | ||
|
|
||
| Handles smartcard container instances for key pair storage. | ||
| """ | ||
| def __init__(self): | ||
| super().__init__() | ||
|
|
||
|
|
||
| class Shipment(microesb.ClassHandler): | ||
| """ Shipment handler class. | ||
|
|
||
| Handles shipment instances. | ||
| """ | ||
| def __init__(self): | ||
| super().__init__() | ||
|
|
||
|
|
||
| class Palette(microesb.MultiClassHandler): | ||
| """ Palette handler class. | ||
|
|
||
| Handles multiple palette instances using MultiClassHandler. | ||
| """ | ||
| def __init__(self): | ||
| super().__init__() |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,19 +11,24 @@ | |
|
|
||
|
|
||
| class JSONTransformer(): | ||
| """ JSON transfomer class. | ||
| """ JSON transformer class. | ||
|
|
||
| Provides JSON transformation functionality for class hierarchies. | ||
| """ | ||
|
|
||
| def __init__(self): | ||
| """ | ||
| :ivar dict[dict] _json_dict: recursive internal properties processing dict | ||
| :ivar dict _json_dict: recursive internal properties processing dict | ||
|
||
| """ | ||
| self._json_dict = {} | ||
|
|
||
| def json_transform(self): | ||
| """ json_transform() method. | ||
|
|
||
| Recursive generate _json_dict for complete object hierarchy. | ||
| Recursively generate _json_dict for complete object hierarchy. | ||
|
|
||
| Iterates through all elements in the hierarchy and calls set_json_dict() | ||
| on each to populate their json_dict representation. | ||
| """ | ||
|
|
||
| for element in self.iterate(): | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The decorator information should be documented using ':decorator:' or similar, not included in the return description. Consider moving this information to a separate note or removing it from the docstring, as it's implementation detail visible in the code itself.