# Path: pyfeld/xmlHelper.py
# class XmlHelper:
#     @staticmethod
#     def xml_extract_dict(xml, extract_keys):
#         result_dict = {}
#         for k in extract_keys:
#             try:
#                 element = xml.getElementsByTagName(k)
#                 result_dict[k] = element[0].firstChild.nodeValue
#             except Exception as e:
#                 result_dict[k] = ""
#         return result_dict
# 
#     def xml_extract_dict_by_val(xml, extract_keys):
#         result_dict = {}
#         for k in extract_keys:
#             try:
#                 element = xml.getElementsByTagName(k)
#                 result_dict[k] = element[0].getAttribute("val")
#             except Exception as e:
#                 pass
#         return result_dict


import time
from pyfeld.xmlHelper import XmlHelper
                ['TransportStatus', True, False],
                ['Volume', True, False],
                ['VolumeDB', True, False],
                ]



class SingleItem:
    def __init__(self, value):
        self.timeChanged = time.time()
        self.value = value

    def update(self, value):
        self.value = value
        self.timeChanged = time.time()


class SingleUuid:
    def __init__(self, uuid, rf_type, name):
        self.uuid = uuid
        self.rf_type = rf_type
        self.name = name
        self.timeChanged = time.time()
        self.itemMap = dict()

    def update(self, xmldom):
        # print(xmldom.toprettyxml())
        key_list = list()
        for item in UuidStoreKeys.get_key_and_setting():
            key_list.append(item[0])

# Path: pyfeld/xmlHelper.py
# class XmlHelper:
#     @staticmethod
#     def xml_extract_dict(xml, extract_keys):
#         result_dict = {}
#         for k in extract_keys:
#             try:
#                 element = xml.getElementsByTagName(k)
#                 result_dict[k] = element[0].firstChild.nodeValue
#             except Exception as e:
#                 result_dict[k] = ""
#         return result_dict
# 
#     def xml_extract_dict_by_val(xml, extract_keys):
#         result_dict = {}
#         for k in extract_keys:
#             try:
#                 element = xml.getElementsByTagName(k)
#                 result_dict[k] = element[0].getAttribute("val")
#             except Exception as e:
#                 pass
#         return result_dict


# Path: pyfeld/uuidStore.py
import time
from pyfeld.xmlHelper import XmlHelper

                ['TransportStatus', True, False],
                ['Volume', True, False],
                ['VolumeDB', True, False],
                ]



class SingleItem:
    def __init__(self, value):
        self.timeChanged = time.time()
        self.value = value

    def update(self, value):
        self.value = value
        self.timeChanged = time.time()


class SingleUuid:
    def __init__(self, uuid, rf_type, name):
        self.uuid = uuid
        self.rf_type = rf_type
        self.name = name
        self.timeChanged = time.time()
        self.itemMap = dict()

    def update(self, xmldom):
        # print(xmldom.toprettyxml())
        key_list = list()
        for item in UuidStoreKeys.get_key_and_setting():
            key_list.append(item[0])

        items = XmlHelper.xml_extract_dict_by_val(xmldom, key_list)