ZMS repository utility module
This module provides helpful functions and classes for use in Python Scripts. It can be accessed from Python with the statement "import Products.zms.repository"
| Function | get |
Undocumented |
| Function | get |
Undocumented |
| Function | get |
Generate a Python class representation of a given object. |
| Function | get |
Serialize a Python object into a YAML-formatted string. |
| Function | get |
Undocumented |
| Function | get |
Undocumented |
| Function | init |
Generate a dictionary of initialization artefacts from the given object and initialization files. |
| Function | local |
Undocumented |
| Function | parse |
Undocumented |
| Function | read |
Undocumented |
| Function | remote |
Undocumented |
| Variable | security |
Returns system conf-basepath. |
Generate a Python class representation of a given object.
This function takes an object `o` (typically a dictionary) and generates a Python class definition as a list of strings. The generated class includes attributes and nested classes based on the structure and content of the input object.
Args: self: The instance of the class calling this method. o (dict): The input object containing keys and values to be represented as a Python class.
Returns: list: A list of strings representing the Python class definition.
Serialize a Python object into a YAML-formatted string.
This method processes a given object `o` and converts it into a YAML representation. It handles attributes and keys in the object, ensuring that non-serializable elements (e.g., Acquisition-Wrappers) are excluded.
Args: self: The instance of the class containing this method. o (dict): The input dictionary-like object to be serialized. It is expected to have keys and values that can be processed into a YAML-compatible format.
Returns: str: A YAML-formatted string representing the serialized object.
Generate a dictionary of initialization artefacts from the given object and initialization files.
Args: self: The instance of the class containing this method. o (dict): A dictionary representing the object to process. It may contain:
- 'id': The identifier of the object.
- 'acquired': A flag indicating if the object is acquired (0 or 1).
- '__filename__': A list representing the filename structure.
- '__icon__': An optional icon for the object.
- '__description__': An optional description for the object.
- 'revision': A version string in the format "0.0.0".
- Other keys representing attributes, where capitalized keys with list values are processed.
initFiles (dict): A dictionary where keys are formats (e.g., 'py') and values are lists of strings representing the initialization data for each format.
Returns: dict: A dictionary where keys are filenames and values are dictionaries containing:
- 'id': The identifier of the object.
- 'filename': The full path of the file.
- 'data': The content of the file.
- 'version': The version of the file as a list of integers.
- 'meta_type': The meta type of the object (e.g., 'Script (Python)').
- '__icon__': The icon of the object (if provided).
- '__description__': The description of the object (if provided).