Library Reference
The lib.i18n
Module
Localization management.
The lib.utils
Module
Some various utilities.
- cioxml2.lib.utils.special_protect(content: str) str [source]
Convert special characters (&, <, >) in a secure representation.
- cioxml2.lib.utils.special_unprotect(content: str) str [source]
Cancel the protection made by _special_protect().
- cioxml2.lib.utils.image_base64(pbuild: PBuild, abs_path: str, html: str, remove_original: bool = True) str | None [source]
Replace image source with its content in base64.
- cioxml2.lib.utils.remove_css_maps(pbuild: PBuild, step: dict)[source]
Remove CSS maps and their call.
- Parameters:
build (cioprocessor.lib.build.PBuild) – Current build object.
step (dict) – Dictionary defining the current step.
- cioxml2.lib.utils.ajust_css_maps(pbuild: PBuild, step: dict)[source]
Ajust CSS maps and their call.
- Parameters:
build (cioprocessor.lib.build.PBuild) – Current build object.
step (dict) – Dictionary defining the current step.
- cioxml2.lib.utils.pretty_print_json(pbuild: PBuild, step: dict) bool [source]
Pretty print JSON files.
- cioxml2.lib.utils.calling_file(request: Request, rendering_type: str | None = None) tuple[Warehouse | None, CioPath | None, dict | None] [source]
Return warehouse, CioPath and rendering of the URL found in the request.
- Parameters:
request (pyramid.request.Request) – Current request.
rendering_type (str) – (optional) Type of rendering (‘viewing’ or ‘editing’)
- Return type:
The lib.cioset
Module
Cioset management.
- cioxml2.lib.cioset.cioset_update(original: ElementTree, values: dict) ElementTree [source]
Update original Cioset XML according to values.
- Parameters:
original (lxml.etree._ElementTree) – Initial content of the file as a XML DOM object.
values (dict) – Values of the form.
- Return type:
lxml.etree._ElementTree
- cioxml2.lib.cioset.value2string(elt: Element, value: str | None) str [source]
Convert a string value according to type
type_
.
- cioxml2.lib.cioset.root_ciopath(ciopath: CioPath, elt: Element) CioPath [source]
Return the CioPath the root (division… the XML element
elt
.- Parameters:
ciopath (ciowarehouse2.lib.ciopath.CioPath) – CioPath the Cioset file.
elt (lxml.etree.Element) – Cioset XML element for the current file or division.
- Return type:
- cioxml2.lib.cioset.file_ciopath(ciopath: CioPath, file_elt: Element) CioPath [source]
Return the CioPath of the file pointed by
file_elt
, possibly according to <root> tags.- Parameters:
ciopath (ciowarehouse2.lib.ciopath.CioPath) – CioPath of the cioset.
file_elt (lxml.etree.Element) – Cioset XML file element for the current file.
- Return type: