Update json to SQL script to adapt it to latest changes to Phobos
This commit is contained in:
@@ -68,46 +68,18 @@ def main(db, json_path):
|
|||||||
'evetypes': eos.gamedata.Item,
|
'evetypes': eos.gamedata.Item,
|
||||||
'phbtraits': eos.gamedata.Traits,
|
'phbtraits': eos.gamedata.Traits,
|
||||||
'phbmetadata': eos.gamedata.MetaData,
|
'phbmetadata': eos.gamedata.MetaData,
|
||||||
'mapbulk_marketGroups': eos.gamedata.MarketGroup,
|
'marketGroups': eos.gamedata.MarketGroup}
|
||||||
}
|
|
||||||
|
|
||||||
fieldMapping = {
|
fieldMapping = {
|
||||||
'dgmattribs': {
|
|
||||||
'displayName': 'displayName'
|
|
||||||
},
|
|
||||||
'dgmeffects': {
|
|
||||||
'displayName': 'displayName',
|
|
||||||
'description': 'description'
|
|
||||||
},
|
|
||||||
'dgmunits': {
|
|
||||||
'displayName': 'displayName'
|
|
||||||
},
|
|
||||||
#icons???
|
|
||||||
'evecategories': {
|
|
||||||
'categoryName': 'categoryName'
|
|
||||||
},
|
|
||||||
'evegroups': {
|
|
||||||
'groupName': 'groupName'
|
|
||||||
},
|
|
||||||
'invmetagroups': {
|
|
||||||
'metaGroupName': 'metaGroupName'
|
|
||||||
},
|
|
||||||
'evetypes': {
|
|
||||||
'typeName': 'typeName',
|
|
||||||
'description': 'description'
|
|
||||||
},
|
|
||||||
'mapbulk_marketGroups': {
|
'mapbulk_marketGroups': {
|
||||||
'marketGroupName': 'marketGroupName',
|
'id': 'marketGroupID',
|
||||||
'description': 'description'
|
'name': 'marketGroupName'}}
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
rowsInValues = (
|
rowsInValues = (
|
||||||
'evetypes',
|
'evetypes',
|
||||||
'evegroups',
|
'evegroups',
|
||||||
'evecategories'
|
'evecategories',
|
||||||
)
|
'marketGroups')
|
||||||
|
|
||||||
def convertIcons(data):
|
def convertIcons(data):
|
||||||
new = []
|
new = []
|
||||||
@@ -303,7 +275,14 @@ def main(db, json_path):
|
|||||||
with open(os.path.join(jsonPath, '{}.json'.format(jsonName)), encoding='utf-8') as f:
|
with open(os.path.join(jsonPath, '{}.json'.format(jsonName)), encoding='utf-8') as f:
|
||||||
tableData = json.load(f)
|
tableData = json.load(f)
|
||||||
if jsonName in rowsInValues:
|
if jsonName in rowsInValues:
|
||||||
tableData = list(tableData.values())
|
newTableData = []
|
||||||
|
for k, v in tableData.items():
|
||||||
|
row = {}
|
||||||
|
row.update(v)
|
||||||
|
if 'id' not in row:
|
||||||
|
row['id'] = int(k)
|
||||||
|
newTableData.append(row)
|
||||||
|
tableData = newTableData
|
||||||
if jsonName == 'icons':
|
if jsonName == 'icons':
|
||||||
tableData = convertIcons(tableData)
|
tableData = convertIcons(tableData)
|
||||||
if jsonName == 'phbtraits':
|
if jsonName == 'phbtraits':
|
||||||
|
|||||||
Reference in New Issue
Block a user