Skip to content

Commit 6bb23d8

Browse files
committed
Rename classes / fns to remove mention of IATI
1 parent fdc70c3 commit 6bb23d8

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

flattentool/sort_iati.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
}
4242

4343

44-
class IATISchemaWalker(object):
44+
class XMLSchemaWalker(object):
4545
"""
4646
Class for traversing one or more XML schemas.
4747
@@ -117,7 +117,7 @@ def create_schema_dict(self, parent_name, parent_element=None):
117117
for name, element, _, _, _ in self.element_loop(parent_element, '')])
118118

119119

120-
def sort_iati_element(element, schema_subdict):
120+
def sort_element(element, schema_subdict):
121121
"""
122122
Sort the given element's children according to the order of schema_subdict.
123123
"""
@@ -134,4 +134,4 @@ def index_key(x):
134134

135135
for child in sorted(children, key=index_key):
136136
element.append(child)
137-
sort_iati_element(child, schema_subdict.get(child.tag, {}))
137+
sort_element(child, schema_subdict.get(child.tag, {}))

flattentool/xml_output.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
USING_LXML = False
1414
warn('Using stdlib etree may work, but is not supported. Please install lxml.')
1515
from flattentool.exceptions import DataErrorWarning
16-
from flattentool.sort_iati import sort_iati_element, IATISchemaWalker
16+
from flattentool.sort_iati import sort_element, XMLSchemaWalker
1717

1818

1919
def sort_attributes(data):
@@ -78,9 +78,9 @@ def toxml(data, xml_root_tag, xml_schemas=None, root_list_path='iati-activity'):
7878
}
7979
root = dict_to_xml(data, xml_root_tag, nsmap=nsmap)
8080
if xml_schemas is not None:
81-
schema_dict = IATISchemaWalker(xml_schemas).create_schema_dict(root_list_path)
81+
schema_dict = XMLSchemaWalker(xml_schemas).create_schema_dict(root_list_path)
8282
for element in root:
83-
sort_iati_element(element, schema_dict)
83+
sort_element(element, schema_dict)
8484
comment = ET.Comment('XML generated by flatten-tool')
8585
root.insert(0, comment)
8686
if USING_LXML:

0 commit comments

Comments
 (0)