import sys
import xml.sax.handler
-class Item:
+class Item(object):
def __init__(self, name):
self.name = name
self.sort_name = name.lower()
pass
class Function(Item):
- pass
+ def __init__(self, name, global_signature, env_signature):
+ super(Function, self).__init__(name)
+ self.global_signature = global_signature
+ self.env_signature = env_signature
class Tool(Item):
def __init__(self, name):
def __str__(self):
s = ''.join(self.body).strip()
result = []
- for m in re.findall('([a-zA-Z_]+|[^a-zA-Z_]+)', s):
+ for m in re.findall('([a-zA-Z/_]+|[^a-zA-Z/_]+)', s):
if ' ' in m:
m = '"%s"' % m
result.append(m)
try:
function = self.functions[name]
except KeyError:
- function = Function(name)
+ function = Function(name,
+ attrs.get('global', "1"),
+ attrs.get('env', "1"))
self.functions[name] = function
self.begin_xxx(function)
def end_scons_function(self):
body = string.replace(body, '<para>\n', '')
body = string.replace(body, '<para>', '\n')
body = string.replace(body, '</para>\n', '')
- body = re.sub('\.EE\n\n+(?!\.IP)', '.EE\n.IP\n', body)
+
+ body = string.replace(body, '<variablelist>\n', '.RS 10\n')
+ body = re.compile(r'<varlistentry>\n<term>([^<]*)</term>\n<listitem>\n').sub(r'.HP 6\n.B \1\n', body)
+ body = string.replace(body, '</listitem>\n', '')
+ body = string.replace(body, '</varlistentry>\n', '')
+ body = string.replace(body, '</variablelist>\n', '.RE\n')
+
+ body = re.sub(r'\.EE\n\n+(?!\.IP)', '.EE\n.IP\n', body)
+ body = string.replace(body, '\n.IP\n\'\\"', '\n\n\'\\"')
body = re.sub('&(scons|SConstruct|SConscript|jar);', r'\\fB\1\\fP', body)
body = string.replace(body, '&Dir;', r'\fBDir\fP')
body = string.replace(body, '⌖', r'\fItarget\fP')