Skip to content

Commit

Permalink
Better XML naming
Browse files Browse the repository at this point in the history
  • Loading branch information
joamag committed Mar 21, 2020
1 parent 30c637b commit 6994514
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 31 deletions.
12 changes: 6 additions & 6 deletions api_at/src/api_at/system.py
Expand Up @@ -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)

Expand All @@ -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")
Expand Down
14 changes: 7 additions & 7 deletions api_easypay/src/api_easypay/system.py
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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):
Expand All @@ -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):
Expand Down
6 changes: 3 additions & 3 deletions api_yadis/src/api_yadis/parser.py
Expand Up @@ -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

Expand All @@ -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

Expand Down Expand Up @@ -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.
"""
Expand Down
2 changes: 1 addition & 1 deletion api_yadis/src/api_yadis/system.py
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion authentication/src/authentication_xml/__init__.py
Expand Up @@ -36,4 +36,4 @@

from . import system

from .system import AuthenticationXml
from .system import AuthenticationXML
4 changes: 2 additions & 2 deletions authentication/src/authentication_xml/system.py
Expand Up @@ -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):
Expand Down
10 changes: 5 additions & 5 deletions authentication/src/authentication_xml_plugin.py
Expand Up @@ -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. <development@hive.pt>"
platforms = [
Expand All @@ -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()
Expand Down
6 changes: 3 additions & 3 deletions printing/src/printing_manager/parser.py
Expand Up @@ -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)
Expand Down Expand Up @@ -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.
"""
Expand Down
4 changes: 2 additions & 2 deletions resources/src/resources_manager/parser.py
Expand Up @@ -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

Expand Down Expand Up @@ -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.
"""
Expand Down
2 changes: 1 addition & 1 deletion template_engine/src/template_engine/visitor.py
Expand Up @@ -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.
Expand Down

0 comments on commit 6994514

Please sign in to comment.