Esempio n. 1
0
def writeXML(filePath, aData, pData, tData):
    """write athenaObject as xml file
    provide three dictionaries: aData, pathData, textureData
    what is written is controled by how pData is packaged
    this is done internally in athenaObj
    """
    msg = []
    parent = "athenaObject"
    msg.append(xmlTools.XMLHEAD)
    msg.append("\n<%s>" % parent)
    msg = msg + xmlTools.pyToXml(parent, "athena", aData, 1, [])
    msg = msg + xmlTools.pyToXml(parent, "paths", pData, 1, [None, None, "pi", None, ("voiceLib", "pv")])
    msg = msg + xmlTools.pyToXml(parent, "textures", tData, 1, [None, None, ("textureLib", "ti", "cloneLib", "tc")])
    msg.append("\n</%s>" % parent)  # close prefs
    f = open(filePath, "w")
    f.writelines(msg)
    f.close()
Esempio n. 2
0
def writePrefDict(prefFilePath, prefDict):
    """given patha and pref, writes as xml file """
    msg = []
    parent = 'preferences'
    msg.append(xmlTools.XMLHEAD)
    msg = msg + xmlTools.pyToXml(parent, 'preferences', prefDict, 0, 
                          [None, 'prefGroup',])   
    f = open(prefFilePath, 'w')
    f.writelines(msg)
    f.close()
Esempio n. 3
0
def writeXML(filePath, aData, pData, tData):
    """write athenaObject as xml file
    provide three dictionaries: aData, pathData, textureData
    what is written is controled by how pData is packaged
    this is done internally in athenaObj
    """
    msg = []
    parent = 'athenaObject'
    msg.append(xmlTools.XMLHEAD)
    msg.append('\n<%s>' % parent)
    msg = msg + xmlTools.pyToXml(parent, 'athena', aData, 1, [])
    msg = msg + xmlTools.pyToXml(parent, 'paths', pData, 1,
                                 [None, None, 'pi', None, ('voiceLib', 'pv')])
    msg = msg + xmlTools.pyToXml(
        parent, 'textures', tData, 1,
        [None, None, ('textureLib', 'ti', 'cloneLib', 'tc')])
    msg.append('\n</%s>' % parent)  # close prefs
    f = open(filePath, 'w')
    f.writelines(msg)
    f.close()
Esempio n. 4
0
def writePrefDict(prefFilePath, prefDict):
    """given patha and pref, writes as xml file """
    msg = []
    parent = 'preferences'
    msg.append(xmlTools.XMLHEAD)
    msg = msg + xmlTools.pyToXml(parent, 'preferences', prefDict, 0, [
        None,
        'prefGroup',
    ])
    f = open(prefFilePath, 'w')
    f.writelines(msg)
    f.close()