Skip to content

Commit 5c7e3fe

Browse files
committed
Remove LSF, convert staticdata files to split files
1 parent 546a3b6 commit 5c7e3fe

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+3923788
-69
lines changed

.gitattributes

+1-3
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,4 @@ pyfa.py text eol=lf
3333
*.jpg binary
3434
*.icns binary
3535
*.ico binary
36-
staticdata/fsd_binary/* filter=lfs diff=lfs merge=lfs -text
37-
staticdata/fsd_lite/* filter=lfs diff=lfs merge=lfs -text
38-
staticdata/phobos/* filter=lfs diff=lfs merge=lfs -text
36+

db_update.py

+36-21
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,25 @@ def update_db():
9393
eos.db.gamedata_meta.create_all()
9494

9595
def _readData(minerName, jsonName, keyIdName=None):
96-
with open(os.path.join(JSON_DIR, minerName, '{}.json'.format(jsonName)), encoding='utf-8') as f:
97-
rawData = json.load(f)
96+
compiled_data = None
97+
for i in itertools.count(0):
98+
try:
99+
with open(os.path.join(JSON_DIR, minerName, '{}.{}.json'.format(jsonName, i)), encoding='utf-8') as f:
100+
rawData = json.load(f)
101+
if i == 0:
102+
compiled_data = {} if type(rawData) == dict else []
103+
if type(rawData) == dict:
104+
compiled_data.update(rawData)
105+
else:
106+
compiled_data.extend(rawData)
107+
except FileNotFoundError:
108+
break
109+
98110
if not keyIdName:
99111
return rawData
100112
# IDs in keys, rows in values
101113
data = []
102-
for k, v in rawData.items():
114+
for k, v in compiled_data.items():
103115
row = {}
104116
row.update(v)
105117
if keyIdName not in row:
@@ -325,24 +337,27 @@ def convertSection(sectionData):
325337

326338
newData = []
327339
for row in data:
328-
newRow = {
329-
'typeID': row['typeID'],
330-
}
331-
for (k, v) in eos.config.translation_mapping.items():
332-
if v == '':
333-
v = '_en-us'
334-
typeLines = []
335-
traitData = row['traits{}'.format(v)]
336-
for skillData in sorted(traitData.get('skills', ()), key=lambda i: i['header']):
337-
typeLines.append(convertSection(skillData))
338-
if 'role' in traitData:
339-
typeLines.append(convertSection(traitData['role']))
340-
if 'misc' in traitData:
341-
typeLines.append(convertSection(traitData['misc']))
342-
traitLine = '<br />\n<br />\n'.join(typeLines)
343-
newRow['traitText{}'.format(v)] = traitLine
344-
345-
newData.append(newRow)
340+
try:
341+
newRow = {
342+
'typeID': row['typeID'],
343+
}
344+
for (k, v) in eos.config.translation_mapping.items():
345+
if v == '':
346+
v = '_en-us'
347+
typeLines = []
348+
traitData = row['traits{}'.format(v)]
349+
for skillData in sorted(traitData.get('skills', ()), key=lambda i: i['header']):
350+
typeLines.append(convertSection(skillData))
351+
if 'role' in traitData:
352+
typeLines.append(convertSection(traitData['role']))
353+
if 'misc' in traitData:
354+
typeLines.append(convertSection(traitData['misc']))
355+
traitLine = '<br />\n<br />\n'.join(typeLines)
356+
newRow['traitText{}'.format(v)] = traitLine
357+
358+
newData.append(newRow)
359+
except:
360+
pass
346361
_addRows(newData, eos.gamedata.Traits, fieldMap={'traitText_en-us': 'display'})
347362

348363
def processMetadata():

0 commit comments

Comments
 (0)