How to use the chameleon.core.utils.meta_attr function in Chameleon

To help you get started, we’ve selected a few Chameleon examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github malthe / chameleon / src / chameleon / zpt / language.py View on Github external
i18n_name = None
    i18n_domain = None
    i18n_translate = None
    i18n_attributes = None

    tal_define = None
    tal_condition = None
    tal_replace = None
    tal_content = None
    tal_repeat = None
    tal_attributes = None

    meta_translator = etree.Annotation(
        utils.meta_attr('translator'))
    meta_interpolation = utils.attribute(
        utils.meta_attr('interpolation'), default='true', recursive=True)
    meta_interpolation_escaping = utils.attribute(
        utils.meta_attr('interpolation-escaping'), default='true', recursive=True)

class XHTMLElement(ZopePageTemplateElement):
    """XHTML namespace element."""

    tal_define = utils.attribute(
        utils.tal_attr('define'), lambda p: p.definitions)
    tal_condition = utils.attribute(
        utils.tal_attr('condition'), lambda p: p.tales)
    tal_repeat = utils.attribute(
        utils.tal_attr('repeat'), lambda p: p.definition)
    tal_attributes = utils.attribute(
        utils.tal_attr('attributes'), lambda p: p.definitions)
    tal_content = utils.attribute(
        utils.tal_attr('content'), lambda p: p.output)
github malthe / chameleon / src / chameleon / genshi / language.py View on Github external
py_def = utils.attribute(
        utils.py_attr('def'), lambda p: p.method)
    py_attrs = utils.attribute(
        utils.py_attr('attrs'), lambda p: p.expression)
    py_content = utils.attribute(
        utils.py_attr('content'), lambda p: p.output)
    py_replace = utils.attribute(
        utils.py_attr('replace'), lambda p: p.output)
    py_strip = utils.attribute(
        utils.py_attr('strip'), lambda p: p.expression)
    meta_translator = etree.Annotation(
        utils.meta_attr('translator'))
    meta_interpolation = utils.attribute(
        utils.meta_attr('interpolation'), default='true', recursive=True)
    meta_interpolation_escaping = utils.attribute(
        utils.meta_attr('interpolation-escaping'), default='true', recursive=True)
    i18n_translate = utils.attribute(
        utils.i18n_attr('translate'))
    i18n_attributes = utils.attribute(
        utils.i18n_attr('attributes'), lambda p: p.mapping)
    i18n_domain = utils.attribute(
        utils.i18n_attr('domain'))
    i18n_name = utils.attribute(
        utils.i18n_attr('name'))

class MetaElement(XHTMLElement, translation.MetaElement):
    pass

class PyElement(XHTMLElement):
    strip_text = True
    py_strip = utils.attribute("strip", lambda p: p.expression, u"")
github malthe / chameleon / src / chameleon / genshi / language.py View on Github external
py_once = utils.attribute(
        utils.py_attr('once'), default='false')
    py_def = utils.attribute(
        utils.py_attr('def'), lambda p: p.method)
    py_attrs = utils.attribute(
        utils.py_attr('attrs'), lambda p: p.expression)
    py_content = utils.attribute(
        utils.py_attr('content'), lambda p: p.output)
    py_replace = utils.attribute(
        utils.py_attr('replace'), lambda p: p.output)
    py_strip = utils.attribute(
        utils.py_attr('strip'), lambda p: p.expression)
    meta_translator = etree.Annotation(
        utils.meta_attr('translator'))
    meta_interpolation = utils.attribute(
        utils.meta_attr('interpolation'), default='true', recursive=True)
    meta_interpolation_escaping = utils.attribute(
        utils.meta_attr('interpolation-escaping'), default='true', recursive=True)
    i18n_translate = utils.attribute(
        utils.i18n_attr('translate'))
    i18n_attributes = utils.attribute(
        utils.i18n_attr('attributes'), lambda p: p.mapping)
    i18n_domain = utils.attribute(
        utils.i18n_attr('domain'))
    i18n_name = utils.attribute(
        utils.i18n_attr('name'))

class MetaElement(XHTMLElement, translation.MetaElement):
    pass

class PyElement(XHTMLElement):
    strip_text = True
github malthe / chameleon / src / chameleon / zpt / language.py View on Github external
i18n_translate = None
    i18n_attributes = None

    tal_define = None
    tal_condition = None
    tal_replace = None
    tal_content = None
    tal_repeat = None
    tal_attributes = None

    meta_translator = etree.Annotation(
        utils.meta_attr('translator'))
    meta_interpolation = utils.attribute(
        utils.meta_attr('interpolation'), default='true', recursive=True)
    meta_interpolation_escaping = utils.attribute(
        utils.meta_attr('interpolation-escaping'), default='true', recursive=True)

class XHTMLElement(ZopePageTemplateElement):
    """XHTML namespace element."""

    tal_define = utils.attribute(
        utils.tal_attr('define'), lambda p: p.definitions)
    tal_condition = utils.attribute(
        utils.tal_attr('condition'), lambda p: p.tales)
    tal_repeat = utils.attribute(
        utils.tal_attr('repeat'), lambda p: p.definition)
    tal_attributes = utils.attribute(
        utils.tal_attr('attributes'), lambda p: p.definitions)
    tal_content = utils.attribute(
        utils.tal_attr('content'), lambda p: p.output)
    tal_replace = utils.attribute(
        utils.tal_attr('replace'), lambda p: p.output)
github malthe / chameleon / src / chameleon / genshi / language.py View on Github external
py_match = utils.attribute(
        utils.py_attr('match'))
    py_once = utils.attribute(
        utils.py_attr('once'), default='false')
    py_def = utils.attribute(
        utils.py_attr('def'), lambda p: p.method)
    py_attrs = utils.attribute(
        utils.py_attr('attrs'), lambda p: p.expression)
    py_content = utils.attribute(
        utils.py_attr('content'), lambda p: p.output)
    py_replace = utils.attribute(
        utils.py_attr('replace'), lambda p: p.output)
    py_strip = utils.attribute(
        utils.py_attr('strip'), lambda p: p.expression)
    meta_translator = etree.Annotation(
        utils.meta_attr('translator'))
    meta_interpolation = utils.attribute(
        utils.meta_attr('interpolation'), default='true', recursive=True)
    meta_interpolation_escaping = utils.attribute(
        utils.meta_attr('interpolation-escaping'), default='true', recursive=True)
    i18n_translate = utils.attribute(
        utils.i18n_attr('translate'))
    i18n_attributes = utils.attribute(
        utils.i18n_attr('attributes'), lambda p: p.mapping)
    i18n_domain = utils.attribute(
        utils.i18n_attr('domain'))
    i18n_name = utils.attribute(
        utils.i18n_attr('name'))

class MetaElement(XHTMLElement, translation.MetaElement):
    pass
github malthe / chameleon / src / chameleon / zpt / language.py View on Github external
metal_defineslot = None

    i18n_name = None
    i18n_domain = None
    i18n_translate = None
    i18n_attributes = None

    tal_define = None
    tal_condition = None
    tal_replace = None
    tal_content = None
    tal_repeat = None
    tal_attributes = None

    meta_translator = etree.Annotation(
        utils.meta_attr('translator'))
    meta_interpolation = utils.attribute(
        utils.meta_attr('interpolation'), default='true', recursive=True)
    meta_interpolation_escaping = utils.attribute(
        utils.meta_attr('interpolation-escaping'), default='true', recursive=True)

class XHTMLElement(ZopePageTemplateElement):
    """XHTML namespace element."""

    tal_define = utils.attribute(
        utils.tal_attr('define'), lambda p: p.definitions)
    tal_condition = utils.attribute(
        utils.tal_attr('condition'), lambda p: p.tales)
    tal_repeat = utils.attribute(
        utils.tal_attr('repeat'), lambda p: p.definition)
    tal_attributes = utils.attribute(
        utils.tal_attr('attributes'), lambda p: p.definitions)