Пример #1
0
    def macro_emit(self, node):
        # print node.debug()
        macro_name = node.macro_name
        text = node.content
        macro = None

        args = node.macro_args
        try:
            macro_kwargs = str2dict(args)
        except ValueError, e:
            exc_info = sys.exc_info()
            return self.error(
                u"Wrong macro arguments: %r for macro '%s' (maybe wrong macro tag syntax?)" % (args, macro_name),
                exc_info,
            )
Пример #2
0
    def macro_emit(self, node):
        #print node.debug()
        macro_name = node.macro_name
        text = node.content
        macro = None

        args = node.macro_args
        macro_kwargs = str2dict(args)
        macro_kwargs["text"] = text

        if callable(self.macros) == True:
            raise DeprecationWarning("Callable macros are not supported anymore!")
            return

        exc_info = None
        if isinstance(self.macros, dict):
            try:
                macro = self.macros[macro_name]
            except KeyError, e:
                exc_info = sys.exc_info()