mirror of
https://github.com/SystemRage/py-kms.git
synced 2024-11-26 02:05:39 +01:00
Delete kmsDB2Dict.py
This commit is contained in:
parent
374a10b729
commit
9d011c4b7a
@ -1,45 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import os
|
||||
import xml.etree.ElementTree as ET
|
||||
|
||||
def kmsDB2Dict():
|
||||
path = os.path.join(os.path.dirname(__file__), 'KmsDataBase.xml')
|
||||
root = ET.parse(path).getroot()
|
||||
|
||||
kmsdb, child1, child2, child3 = [ [] for _ in range(4) ]
|
||||
|
||||
## Get winbuilds.
|
||||
for winbuild in root.iter('WinBuild'):
|
||||
child1.append(winbuild.attrib)
|
||||
|
||||
kmsdb.append(child1)
|
||||
|
||||
## Get csvlkitem data.
|
||||
child1 = []
|
||||
for csvlk in root.iter('CsvlkItem'):
|
||||
for activ in csvlk.iter('Activate'):
|
||||
child2.append(activ.attrib['KmsItem'])
|
||||
csvlk.attrib.update({'Activate' : child2})
|
||||
child1.append(csvlk.attrib)
|
||||
child2 = []
|
||||
|
||||
kmsdb.append(child1)
|
||||
|
||||
## Get appitem data.
|
||||
child1 = []
|
||||
for app in root.iter('AppItem'):
|
||||
for kms in app.iter('KmsItem'):
|
||||
for sku in kms.iter('SkuItem'):
|
||||
child3.append(sku.attrib)
|
||||
kms.attrib.update({'SkuItems' : child3})
|
||||
child2.append(kms.attrib)
|
||||
child3 = []
|
||||
|
||||
app.attrib.update({'KmsItems' : child2})
|
||||
child1.append(app.attrib)
|
||||
child2 = []
|
||||
|
||||
kmsdb.append(child1)
|
||||
|
||||
return kmsdb
|
Loading…
Reference in New Issue
Block a user