[selinux-policy: 1174/3172] fix for lineno and filename attributes
Daniel J Walsh
dwalsh at fedoraproject.org
Thu Oct 7 20:46:28 UTC 2010
commit bff1cef8fe7f623e32e0ef6621e280bf142b2580
Author: Chris PeBenito <cpebenito at tresys.com>
Date: Wed Feb 1 13:08:48 2006 +0000
fix for lineno and filename attributes
refpolicy/support/sedoctool.py | 34 ++++++++++++++--------------------
1 files changed, 14 insertions(+), 20 deletions(-)
---
diff --git a/refpolicy/support/sedoctool.py b/refpolicy/support/sedoctool.py
index f54f002..1868ca2 100755
--- a/refpolicy/support/sedoctool.py
+++ b/refpolicy/support/sedoctool.py
@@ -401,8 +401,8 @@ def gen_docs(doc, working_dir, templatedir):
for interface in node.getElementsByTagName("interface"):
interface_parameters = []
interface_desc = interface_summary = None
- for i,v in interface.attributes.items():
- interface_name = v
+ interface_name = interface.getAttribute("name")
+ interface_line = interface.getAttribute("lineno")
for desc in interface.getElementsByTagName("desc"):
interface_desc = format_html_desc(desc)
for desc in interface.getElementsByTagName("summary"):
@@ -410,14 +410,11 @@ def gen_docs(doc, working_dir, templatedir):
for args in interface.getElementsByTagName("param"):
paramdesc = args.firstChild.data
- paramname = None
- paramopt = "No"
- for name,val in args.attributes.items():
- if name == "name":
- paramname = val
- if name == "optional":
- if val == "true":
- paramopt = "yes"
+ paramname = args.getAttribute("name")
+ if args.getAttribute("optional") == "true":
+ paramopt = "Yes"
+ else:
+ paramopt = "No"
parameter = { "name" : paramname,
"desc" : paramdesc,
"optional" : paramopt }
@@ -443,8 +440,8 @@ def gen_docs(doc, working_dir, templatedir):
for template in node.getElementsByTagName("template"):
template_parameters = []
template_desc = template_summary = None
- for i,v in template.attributes.items():
- template_name = v
+ template_name = template.getAttribute("name")
+ template_line = template.getAttribute("lineno")
for desc in template.getElementsByTagName("desc"):
template_desc = format_html_desc(desc)
for desc in template.getElementsByTagName("summary"):
@@ -452,14 +449,11 @@ def gen_docs(doc, working_dir, templatedir):
for args in template.getElementsByTagName("param"):
paramdesc = args.firstChild.data
- paramname = None
- paramopt = "No"
- for name,val in args.attributes.items():
- if name == "name":
- paramname = val
- if name == "optional":
- if val == "true":
- paramopt = "yes"
+ paramname = args.getAttribute("name")
+ if args.getAttribute("optional") == "true":
+ paramopt = "Yes"
+ else:
+ paramopt = "No"
parameter = { "name" : paramname,
"desc" : paramdesc,
"optional" : paramopt }
More information about the scm-commits
mailing list