summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2010-03-04 02:16:32 +0000
committerSteven Knight <knight@baldmt.com>2010-03-04 02:16:32 +0000
commit240fd8d7b1778e531e056ca2cbb4a6584cf892a3 (patch)
treee074681c742958688517946f855a8fa11fe7288b /bin
parent7fbe49f3e22856a6effcaab8e3c2b8858b889ab4 (diff)
downloadscons-240fd8d7b1778e531e056ca2cbb4a6584cf892a3.tar.gz
More enhancements for documenting functions:
* Add the support for global="0" and env="0" to SConsDoc.py. * Remove unnecessary .IP lines before '\""" delimiters before the next builder / tool / function entry. * Add support for <variablelist> lists.
Diffstat (limited to 'bin')
-rw-r--r--bin/SConsDoc.py13
-rw-r--r--bin/scons-proc.py10
2 files changed, 18 insertions, 5 deletions
diff --git a/bin/SConsDoc.py b/bin/SConsDoc.py
index 72d8c1cf..cd78195a 100644
--- a/bin/SConsDoc.py
+++ b/bin/SConsDoc.py
@@ -114,7 +114,7 @@ import re
import sys
import xml.sax.handler
-class Item:
+class Item(object):
def __init__(self, name):
self.name = name
self.sort_name = name.lower()
@@ -134,7 +134,10 @@ class Builder(Item):
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):
@@ -164,7 +167,7 @@ class Arguments:
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)
@@ -296,7 +299,9 @@ class SConsDocHandler(xml.sax.handler.ContentHandler,
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):
diff --git a/bin/scons-proc.py b/bin/scons-proc.py
index b6c59d65..41ff09a5 100644
--- a/bin/scons-proc.py
+++ b/bin/scons-proc.py
@@ -209,7 +209,15 @@ class SCons_XML_to_man(SCons_XML):
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, '&target;', r'\fItarget\fP')