/usr/share/sumo/tools/xml/configTemplateToWiki.py is in sumo-tools 0.15.0~dfsg-2.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | #!/usr/bin/env python
"""
@file configTemplateToWiki.py
@author Michael Behrisch
@version $Id: configTemplateToWiki.py 12052 2012-03-12 07:11:59Z behrisch $
Generate Wiki table from configuration template.
SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
Copyright (C) 2008-2012 DLR (http://www.dlr.de/) and contributors
All rights reserved
"""
import sys
from xml.sax import parse, handler
class ConfigReader(handler.ContentHandler):
def __init__(self):
self._level = 0
def startElement(self, name, attrs):
if self._level == 1:
# subtopic
print """===%s===
{| cellspacing="0" border="1" width="90%%" align="center"
|-
! style="background:#ddffdd;" valign="top" | Option
! style="background:#ddffdd;" valign="top" | Default Value
! style="background:#ddffdd;" valign="top" | Description""" % name.replace("_", " ").title()
if self._level == 2:
# entry
print '|-\n| valign="top" |',;
a = ""
for s in attrs.get('synonymes', '').split():
if len(s) == 1:
a = s
if a != "":
print '{{Option|-%s {{DT_%s}}}}<br/>' % (a, attrs['type']),
print '{{Option|--%s {{DT_%s}}}}' % (name, attrs['type'])
print '| valign="top" |', attrs['value'];
print '| valign="top" |', attrs['help'];
self._level += 1
def endElement(self, name):
self._level -= 1
if self._level == 1:
# subtopic end
print "|-\n|}\n"
if __name__ == "__main__":
parse(sys.argv[1], ConfigReader())
|