Back to index

moin  1.9.0~rc2
Functions | Variables
MoinMoin.macro.TeudView Namespace Reference

Functions

def macro_TeudView

Variables

 _imperr = None
list Dependencies = ["time"]

Function Documentation

Definition at line 29 of file TeudView.py.

00029 
00030 def macro_TeudView(macro):
00031     if _imperr: return "Error in TeudView macro: " + str(_imperr)
00032 
00033     #dtdfile = xmldoc.getDTDPath()
00034     xslfile = xmldoc.getDataPath('webde.xsl')
00035     pagename = macro.formatter.page.page_name
00036 
00037     if 'module' in macro.request.args:
00038         modname = macro.request.args["module"]
00039         try:
00040             obj = pydoc.locate(modname)
00041         except pydoc.ErrorDuringImport, value:
00042             return "Error while loading module %s: %s" % (modname, value)
00043         else:
00044             xmlstr = xmldoc.xml.document(obj, encoding=config.charset)
00045 
00046         navigation = '<a href="%s">Index</a>' % pagename
00047         pathlen = modname.count('.')
00048         if pathlen:
00049             navigation = navigation + ' | '
00050             modparts = modname.split('.')
00051             for pathidx in range(pathlen):
00052                 path = '.'.join(modparts[:pathidx+1])
00053                 navigation = navigation + '<a href="%s?module=%s">%s</a>' % (
00054                     pagename, path, modparts[pathidx])
00055                 if pathidx < pathlen:
00056                     navigation = navigation + '.'
00057         navigation = navigation + '<hr size="1">'
00058     else:
00059         # generate index
00060         xmlstr = xmldoc.xml.document(None, encoding=config.charset)
00061         navigation = ''
00062 
00063     processor = Processor()
00064     processor.appendStylesheetFile(xslfile)
00065     try:
00066         result = processor.runString(xmlstr,
00067             topLevelParams={
00068                 'uri-prefix': pagename + "?module=",
00069                 'uri-suffix': "",
00070             }
00071         )
00072     except:
00073         print wikiutil.escape(xmlstr)
00074         raise
00075 
00076     return navigation + result
00077 

Variable Documentation

Definition at line 15 of file TeudView.py.

Definition at line 27 of file TeudView.py.