Exemple #1
0
        navigation = '<a href="%s">Index</a>' % pagename
        pathlen = modname.count('.')
        if pathlen:
            navigation = navigation + ' | '
            modparts = modname.split('.')
            for pathidx in range(pathlen):
                path = '.'.join(modparts[:pathidx + 1])
                navigation = navigation + '<a href="%s?module=%s">%s</a>' % (
                    pagename, path, modparts[pathidx])
                if pathidx < pathlen:
                    navigation = navigation + '.'
        navigation = navigation + '<hr size="1">'
    else:
        # generate index
        xmlstr = xmldoc.xml.document(None, encoding=config.charset)
        navigation = ''

    processor = Processor()
    processor.appendStylesheetFile(xslfile)
    try:
        result = processor.runString(xmlstr,
                                     topLevelParams={
                                         'uri-prefix': pagename + "?module=",
                                         'uri-suffix': "",
                                     })
    except:
        print wikiutil.escape(xmlstr)
        raise

    return navigation + result
Exemple #2
0
        if pathlen:
            navigation = navigation + ' | '
            modparts = modname.split('.')
            for pathidx in range(pathlen):
                path = '.'.join(modparts[:pathidx+1])
                navigation = navigation + '<a href="%s?module=%s">%s</a>' % (
                    pagename, path, modparts[pathidx])
                if pathidx < pathlen:
                    navigation = navigation + '.'
        navigation = navigation + '<hr size="1">'
    else:
        # generate index
        xmlstr = xmldoc.xml.document(None, encoding=config.charset)
        navigation = ''

    processor = Processor()
    processor.appendStylesheetFile(xslfile)
    try:
        result = processor.runString(xmlstr,
            topLevelParams={
                'uri-prefix': pagename + "?module=",
                'uri-suffix': "",
            }
        )
    except:
        print wikiutil.escape(xmlstr)
        raise

    return navigation + result