From 6994514cfac64919e4c2f5ec88462d4a52395ef7 Mon Sep 17 00:00:00 2001 From: joamag Date: Sat, 21 Mar 2020 19:19:40 +0000 Subject: [PATCH] Better XML naming --- api_at/src/api_at/system.py | 12 ++++++------ api_easypay/src/api_easypay/system.py | 14 +++++++------- api_yadis/src/api_yadis/parser.py | 6 +++--- api_yadis/src/api_yadis/system.py | 2 +- authentication/src/authentication_xml/__init__.py | 2 +- authentication/src/authentication_xml/system.py | 4 ++-- authentication/src/authentication_xml_plugin.py | 10 +++++----- printing/src/printing_manager/parser.py | 6 +++--- resources/src/resources_manager/parser.py | 4 ++-- template_engine/src/template_engine/visitor.py | 2 +- 10 files changed, 31 insertions(+), 31 deletions(-) diff --git a/api_at/src/api_at/system.py b/api_at/src/api_at/system.py index f09d4205ec..a7020ecceb 100644 --- a/api_at/src/api_at/system.py +++ b/api_at/src/api_at/system.py @@ -425,21 +425,21 @@ def _fetch_url(self, url, parameters = None, method = "GET", contents = None): def get_at_document_id(self, data): """ - Parses the provided xml data, retrieving the + Parses the provided XML data, retrieving the document identifier containing it. - The provided xml data should be compliant with + The provided XML data should be compliant with the pre-defined AT SOAP response. :type data: String - :param data: The string containing the xml data + :param data: The string containing the XML data to be used for parsing and retrieval of the document identifier. :rtype: String :return: The AT document id. """ - # parses the xml data and retrieves the entry document + # parses the XML data and retrieves the entry document # structure that will be uses in the parsing document = xml.dom.minidom.parseString(data) @@ -461,11 +461,11 @@ def _check_at_errors(self, data): :param data: The data to be checked for AT errors. """ - # parses the xml data and retrieves the entry document + # parses the XML data and retrieves the entry document # structure that will be uses in the parsing document = xml.dom.minidom.parseString(data) - # tries to retrieve the various elements from the xml data + # tries to retrieve the various elements from the XML data # that represent error information, an error may be either # a normal message based error or a fault fault_strings = document.getElementsByTagName("faultstring") diff --git a/api_easypay/src/api_easypay/system.py b/api_easypay/src/api_easypay/system.py index 582c70ca6a..f40ba136ee 100644 --- a/api_easypay/src/api_easypay/system.py +++ b/api_easypay/src/api_easypay/system.py @@ -243,7 +243,7 @@ def generate_reference( if mobile: parameters["o_mobile"] = mobile if email: parameters["o_email"] = email - # fetches the retrieval URL with the given parameters retrieving the xml + # fetches the retrieval URL with the given parameters retrieving the XML result = self._fetch_url(retrieval_url, parameters) # parses the result (response) and retrieves the root node @@ -300,7 +300,7 @@ def cancel_reference(self, entity, reference): parameters["ep_ref"] = reference parameters["ep_delete"] = "yes" - # fetches the retrieval URL with the given parameters retrieving the xml + # fetches the retrieval URL with the given parameters retrieving the XML result = self._fetch_url(retrieval_url, parameters) # parses the result (response) and retrieves the root node @@ -354,7 +354,7 @@ def get_payment_details(self, document_identifier, reference_key): parameters["ep_doc"] = document_identifier parameters["ep_key"] = reference_key - # fetches the retrieval URL with the given parameters retrieving the xml + # fetches the retrieval URL with the given parameters retrieving the XML result = self._fetch_url(retrieval_url, parameters) # parses the result (response) and retrieves the root node @@ -588,16 +588,16 @@ def _get_http_client(self): return self.http_client def get_xml_node_text(self, xml_document, xml_tag_name): - # retrieves the xml nodes, returning none + # retrieves the XML nodes, returning none # in case the retrieved nodes are empty xml_nodes = xml_document.getElementsByTagName(xml_tag_name) if not xml_nodes: return None - # retrieves the xml node (first), and its text + # retrieves the XML node (first), and its text xml_node = xml_nodes[0] xml_node_text = self._get_xml_node_text(xml_node) - # returns the xml node text + # returns the XML node text return xml_node_text def _get_xml_node_text(self, xml_node): @@ -611,7 +611,7 @@ def _get_xml_node_text(self, xml_node): # converts the child text nodes to a string xml_node_text = "".join(child_node_data_list) - # returns the xml node text + # returns the XML node text return xml_node_text class EasypayStructure(object): diff --git a/api_yadis/src/api_yadis/parser.py b/api_yadis/src/api_yadis/parser.py index 82cce7f603..279c46ae47 100644 --- a/api_yadis/src/api_yadis/parser.py +++ b/api_yadis/src/api_yadis/parser.py @@ -93,7 +93,7 @@ def get_resources_list(self): return self.resources_list def load_yadis_file(self, file_path): - # creates the xml doument DOM object + # creates the XML document DOM object xml_document = xml.dom.minidom.parse(file_path) child_nodes = xml_document.childNodes @@ -102,7 +102,7 @@ def load_yadis_file(self, file_path): self.resources_list = self.parse_resources(child_node) def load_yadis_contents(self, file_contents): - # creates the xml doument DOM object + # creates the XML document DOM object xml_document = xml.dom.minidom.parseString(file_contents) child_nodes = xml_document.childNodes @@ -260,7 +260,7 @@ def valid_node(node): Gets if a node is valid or not for parsing. :type node: Node - :param node: The Xml node to be validated. + :param node: The XML node to be validated. :rtype: bool :return: The valid or not valid value. """ diff --git a/api_yadis/src/api_yadis/system.py b/api_yadis/src/api_yadis/system.py index 07f1c0fb35..712877ae87 100644 --- a/api_yadis/src/api_yadis/system.py +++ b/api_yadis/src/api_yadis/system.py @@ -161,7 +161,7 @@ def get_resource_descriptor(self): # start the parameters map parameters = {} - # fetches the retrieval URL with the given parameters retrieving the xml response + # fetches the retrieval URL with the given parameters retrieving the XML response result = self._fetch_url(retrieval_url, parameters) # creates a new resource descriptor parser diff --git a/authentication/src/authentication_xml/__init__.py b/authentication/src/authentication_xml/__init__.py index 43c1bfd47e..3bc22b9cca 100644 --- a/authentication/src/authentication_xml/__init__.py +++ b/authentication/src/authentication_xml/__init__.py @@ -36,4 +36,4 @@ from . import system -from .system import AuthenticationXml +from .system import AuthenticationXML diff --git a/authentication/src/authentication_xml/system.py b/authentication/src/authentication_xml/system.py index 743bd47632..42fb32bef4 100644 --- a/authentication/src/authentication_xml/system.py +++ b/authentication/src/authentication_xml/system.py @@ -42,9 +42,9 @@ HANDLER_NAME = "xml" """ The handler name """ -class AuthenticationXml(colony.System): +class AuthenticationXML(colony.System): """ - The authentication xml class. + The authentication XML class. """ def get_handler_name(self): diff --git a/authentication/src/authentication_xml_plugin.py b/authentication/src/authentication_xml_plugin.py index a8c356c151..553279dbf5 100644 --- a/authentication/src/authentication_xml_plugin.py +++ b/authentication/src/authentication_xml_plugin.py @@ -39,14 +39,14 @@ import colony -class AuthenticationXmlPlugin(colony.Plugin): +class AuthenticationXMLPlugin(colony.Plugin): """ - The main class for the Authentication Xml plugin. + The main class for the Authentication XML plugin. """ id = "pt.hive.colony.plugins.authentication.xml" - name = "Authentication Xml" - description = "Authentication Xml Plugin" + name = "Authentication XML" + description = "Authentication XML Plugin" version = "1.0.0" author = "Hive Solutions Lda. " platforms = [ @@ -62,7 +62,7 @@ class AuthenticationXmlPlugin(colony.Plugin): def load_plugin(self): colony.Plugin.load_plugin(self) import authentication_xml - self.system = authentication_xml.AuthenticationXml(self) + self.system = authentication_xml.AuthenticationXML(self) def get_handler_name(self): return self.system.get_handler_name() diff --git a/printing/src/printing_manager/parser.py b/printing/src/printing_manager/parser.py index dac267af94..aa2b1d860f 100644 --- a/printing/src/printing_manager/parser.py +++ b/printing/src/printing_manager/parser.py @@ -116,13 +116,13 @@ def get_build_automation(self): return self.printing_document def load_printing_language_file(self, file): - # creates the xml document DOM object + # creates the XML document DOM object xml_document = xml.dom.minidom.parse(file) self.load_printing_language(xml_document) def load_printing_language_string(self, string): - # creates the xml document DOM object, the provided + # creates the XML document DOM object, the provided # string is encoded to avoid possible parsing problems string = type(string) == colony.legacy.UNICODE and string.encode(DEFAULT_CHARSET) or string xml_document = xml.dom.minidom.parseString(string) @@ -258,7 +258,7 @@ def valid_node(node): Gets if a node is valid or not for parsing. :type node: Node - :param node: The Xml node to be validated. + :param node: The XML node to be validated. :rtype: bool :return: The valid or not valid value. """ diff --git a/resources/src/resources_manager/parser.py b/resources/src/resources_manager/parser.py index cbff5afb24..18e1c80789 100644 --- a/resources/src/resources_manager/parser.py +++ b/resources/src/resources_manager/parser.py @@ -93,7 +93,7 @@ def get_resource_list(self): return self.resource_list def load_resource_file(self, file_path): - # creates the xml doument DOM object + # creates the XML document DOM object xml_document = xml.dom.minidom.parse(file_path) child_nodes = xml_document.childNodes @@ -408,7 +408,7 @@ def valid_node(node): Gets if a node is valid or not for parsing. :type node: Node - :param node: The Xml node to be validated. + :param node: The XML node to be validated. :rtype: bool :return: The valid or not valid value. """ diff --git a/template_engine/src/template_engine/visitor.py b/template_engine/src/template_engine/visitor.py index 6adb328fd2..615a12faca 100644 --- a/template_engine/src/template_engine/visitor.py +++ b/template_engine/src/template_engine/visitor.py @@ -966,7 +966,7 @@ def get_value(self, attribute, meta = None, localize = False, default = None): :param attribute: A map describing the attribute structure. :type meta: Dictionary :param meta: The map containing the meta-information related with - the attribute in question (eg: xml escaping). + the attribute in question (eg: XML escaping). :type localize: bool :param localize: If the value must be localized using the currently available locale bundles.