change doctool to bring in line with the xml tag change (layers encapsulate

modules)
This commit is contained in:
Chris PeBenito 2005-06-20 20:31:58 +00:00
parent e04b8e7832
commit 7fb9c1c72b
1 changed files with 13 additions and 18 deletions

View File

@ -56,15 +56,12 @@ def gen_module_conf(doc, file):
file.write("# creation, uncomment the line with its name.\n#\n") file.write("# creation, uncomment the line with its name.\n#\n")
for node in doc.getElementsByTagName("module"): for node in doc.getElementsByTagName("module"):
mod_name = mod_layer = None mod_name = mod_layer = None
for (name, value) in node.attributes.items():
if name == "name":
mod_name = value
if name == "layer":
mod_layer = value
if mod_name and mod_layer: mod_name = node.attributes.items()[0][1]
file.write("# Layer: %s\n# Module: %s\n#\n" % (mod_layer,mod_name)) mod_layer = node.parentNode.attributes.items()[0][1]
if mod_name and mod_layer:
file.write("# Layer: %s\n# Module: %s\n#\n" % (mod_layer,mod_name))
for desc in node.getElementsByTagName("summary"): for desc in node.getElementsByTagName("summary"):
if not desc.parentNode == node: if not desc.parentNode == node:
continue continue
@ -159,18 +156,17 @@ def gen_docs(doc, dir, templatedir):
try: try:
os.chdir(dir) os.chdir(dir)
except: except:
error("Could now chdir to target directory") error("Could not chdir to target directory")
#arg, i have to go through this dom tree ahead of time to build up the menus #arg, i have to go through this dom tree ahead of time to build up the menus
module_list = {} module_list = {}
for node in doc.getElementsByTagName("module"): for node in doc.getElementsByTagName("module"):
mod_name = mod_layer = interface_buf = '' mod_name = mod_layer = interface_buf = ''
for (name, value) in node.attributes.items():
if name == "name": mod_name = node.attributes.items()[0][1]
mod_name = value mod_layer = node.parentNode.attributes.items()[0][1]
if name == "layer":
mod_layer = value
for desc in node.getElementsByTagName("summary"): for desc in node.getElementsByTagName("summary"):
if desc.parentNode == node and desc: if desc.parentNode == node and desc:
mod_summary = format_html_desc(desc) mod_summary = format_html_desc(desc)
@ -222,11 +218,10 @@ def gen_docs(doc, dir, templatedir):
all_interfaces = [] all_interfaces = []
for node in doc.getElementsByTagName("module"): for node in doc.getElementsByTagName("module"):
mod_name = mod_layer = mod_desc = interface_buf = '' mod_name = mod_layer = mod_desc = interface_buf = ''
for (name, value) in node.attributes.items():
if name == "name": mod_name = node.attributes.items()[0][1]
mod_name = value mod_layer = node.parentNode.attributes.items()[0][1]
if name == "layer":
mod_layer = value
for desc in node.getElementsByTagName("summary"): for desc in node.getElementsByTagName("summary"):
if desc.parentNode == node: if desc.parentNode == node:
mod_summary = format_html_desc(desc) mod_summary = format_html_desc(desc)