Commit 60816542 authored by Etienne Nadji's avatar Etienne Nadji
Browse files

Filtering all_undocumented_to_xml

	modifié :         common/xml.py
	modifié :         pageobjects.py
parent ea340123
......@@ -431,7 +431,7 @@ def all_undocumented_to_python(xml: ET._Element):
def all_undocumented_to_xml(
xml: ET._Element, undocumented: dict,
report: bool = True, msg: str = ""):
report: bool = True, msg: str = "", passattr: list = []):
"""
Function to manage the export of undocumented
XML/SLA attributes.
......@@ -449,6 +449,8 @@ def all_undocumented_to_xml(
:type msg: str
:param msg: Human readable name for the xml element when report parameter
is True.
:type passattr: list
:param passattr: List of SLA attributes names to not report. For debug.
:returns: List containing LXML element and undocumented attributes
names list.
:rtype: list
......@@ -465,10 +467,12 @@ def all_undocumented_to_xml(
if att_name not in xml.attrib:
xml.attrib[att_name] = att_value
undoc_attribs.append(att_name)
if not passattr or att_name not in passattr:
undoc_attribs.append(att_name)
if report and undoc_attribs:
print("Undocumented XML attributes in {} :".format(msg))
print("Undocumented XML attributes in {} :".format(msg.strip()))
pprint.pprint(undoc_attribs, width=80, compact=True)
return [xml, undoc_attribs]
......
......@@ -499,6 +499,10 @@ class PageObject(xmlc.PyScribusElement):
if self.ptype in ["polyline", "polygon"]:
# TODO FIXME Undocumented in polyline, polygon
if (fillrule := xml.get("fillRule")) is not None:
pass
if (line_end := xml.get("PLINEEND")) is not None:
for human, code in PageObject.line_endcap_xml.items():
if line_end == code:
......@@ -687,7 +691,9 @@ class PageObject(xmlc.PyScribusElement):
try:
xml, undoc_attribs = xmlc.all_undocumented_to_xml(
xml, self.undocumented, True,
self.ptype + " frame '" + self.name + "'"
self.ptype + " frame '" + self.name + "'",
# FIXME This disable debug for path, copath attributes
# ["path", "copath"]
)
except AttributeError:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment