Hello,
I have the following:
class MyMacro(WikiMacroBase):
def expand_macro(self, formatter, name, args):
return WikiPage(self.env, formatter.context.resource).name
[[MyMacro]] correct return page name. But if I load page in other
Macro from another page by call WikiPage(..., page) which include this
[[MyMacro]], this return unexpexted result.
For example:
class AnotherMacro(WikiMacroBase):
def wiki_output(self, formatter, content):
out = StringIO()
Formatter(self.env, formatter.context).format(content, out)
return Markup(out.getvalue())
def expand_macro(self, formatter, name, args):
page = WikiPage(self.env, pagewhichincludemymacro)
return wiki_output(formatter, page.text)
I want to retrieve page name where MyMacro located really at
MyMacro.expand_macro . Thanks
--
You received this message because you are subscribed to the Google Groups "Trac
Development" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/trac-dev?hl=en.