Library Reference

The lib.i18n Module

Localization management.

cioxml.lib.i18n.translate(text, lang=None, request=None)[source]

Return text translated.

Parameters:
  • text (str) – Text to translate.

  • lang (str) – (optional) Language to use.

  • request (pyramid.request.Request) – (optional) Current request to find the current language.

Return type:

str

The lib.utils Module

Some various utilities.

cioxml.lib.utils.special_protect(content)[source]

Convert special characters (&, <, >) in a secure representation.

Parameters:

content (str) – Content to protect.

Return type:

str

cioxml.lib.utils.special_unprotect(content)[source]

Cancel the protection made by _special_protect().

Parameters:

content (str) – Protected content.

Return type:

str

cioxml.lib.utils.image_base64(pbuild, abs_path, html)[source]

“Replace image source with its content in base64.

Parameters:
  • pbuild (.lib.pbuild.PBuild) – Current processor build object.

  • abs_path (str) – Absolute path to current directory.

  • html (str) – HTML to process.

Return type:

str

cioxml.lib.utils.remove_css_maps(pbuild, step)[source]

Remove CSS maps and their call.

Parameters:
  • build (cioprocessor.lib.build.PBuild) – Current build object.

  • step (dict) – Dictionary defining the current step.

cioxml.lib.utils.ajust_css_maps(pbuild, step)[source]

Ajust CSS maps and their call.

Parameters:
  • build (cioprocessor.lib.build.PBuild) – Current build object.

  • step (dict) – Dictionary defining the current step.

cioxml.lib.utils.pretty_print_json(pbuild, step)[source]

Pretty print JSON files.

Parameters:
  • build (cioprocessor.lib.build.PBuild) – Current build object.

  • step (dict) – Dictionary defining the current step.

Return type:

bool

The lib.cioset Module

Cioset management.

cioxml.lib.cioset.cioset_update(original, values)[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

cioxml.lib.cioset.value2string(elt, value)[source]

Convert a string value according to type type_.

Parameters:
  • elt (lxml.etree.Element) – DOM element owner of the value.

  • value (str) – Type of the value.

Return type:

str