How to use the chameleon.core.types 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 / genshi / language.py View on Github external
def macro(self):
            if self.element.py_match is not None:
                if self.match_symbol not in itertools.chain(
                    *self.element.stream.scope):
                    raise NameError(self.match_symbol)
                symbols = self.element.stream.symbols
                args = symbols.out, symbols.write, "select"
                if self.element.py_once.lower() in config.TRUEVALS:
                    once = 1
                else:
                    once = repr(None)
                decorator = '%s("""%s""", %s)' % (
                    self.match_symbol, self.element.py_match, once)
                return types.method(
                    "match", args, decorators=(decorator,))

            return self.element.py_def