import pickle
import xml.etree.ElementTree as ET
tree = ET.parse('tags.xml')
root = tree.getroot()

channels = {}

for child in root:
    try:
        print "{0} - {1}".format(child[1].text, child[2].text)
        tagName = child[1].text
        tagType = child[2].text
        channels[tagName] = {
            'tag':tagName,
            "last_value": "",
            "data_type": tagType,
            "change_amount": .5,
            "last_time_uploaded": 0,
            "min_time_between_uploads": 360
        }

        if tagType == "BOOL":
            channels[tagName]['change_amount'] = None
    except:
        print "oops"
with open('testPickle.p','wb') as tp:
    pickle.dump(channels, tp)
