Merge branch 'master' into citadel

Conflicts:
	config.py
	service/market.py
This commit is contained in:
blitzmann
2016-07-03 01:10:26 -04:00
404 changed files with 1230 additions and 362 deletions

View File

@@ -127,13 +127,14 @@ def unzero(fname):
except (TypeError, ValueError):
pass
if size is None:
fname = '{}_{}{}'.format(prefix, suffix, tail)
fname = '{}_{}'.format(prefix, suffix)
else:
fname = '{}_{}_{}{}'.format(prefix, size, suffix, tail)
fname = '{}_{}_{}'.format(prefix, size, suffix)
return fname
else:
return fname
# Get a list of needed icons based on the items / attributes / etc from the database
for query in (query_items, query_groups, query_cats, query_market, query_attrib):
for row in cursor.execute(query):
fname = row[0]
@@ -142,6 +143,7 @@ for query in (query_items, query_groups, query_cats, query_market, query_attrib)
fname = strip_path(fname)
needed.add(fname)
# Get a list of all the icons we currently have
for fname in os.listdir(icons_dir):
if not os.path.isfile(os.path.join(icons_dir, fname)):
continue
@@ -151,6 +153,7 @@ for fname in os.listdir(icons_dir):
print fname,"exists"
existing.add(fname)
# Get a list of all the icons currently available
for dir in dirs:
for fname in os.listdir(dir):
if not os.path.isfile(os.path.join(dir, fname)):
@@ -163,8 +166,6 @@ for dir in dirs:
# Often items referred to with 01_01 format,
fnames = export.setdefault(stripped.lower(), set())
fnames.add(fname)
fnames = export.setdefault(sizeless.lower(), set())
fnames.add(fname)
def crop_image(img):
w, h = img.size

22
scripts/sdeReadIcons.py Normal file
View File

@@ -0,0 +1,22 @@
'''
A change to EVE Online's cache format rendered Reverence unable to correctly dump the icons file. As a stop gap, this
reads the offical SDE iconIDs.yaml and populates our own icons.json file. This files should then be transferred to the
other JSON files Phobos dumps before being converted to SQL
'''
import yaml
import json
iconDict = {}
stream = open(r"C:\path\to\sde\fsd\iconIDs.yaml", "r")
docs = yaml.load_all(stream)
for doc in docs:
for k,v in doc.items():
iconDict[str(k)] = {"iconFile": v['iconFile']}
with open('icons.json', 'w') as outfile:
json.dump(iconDict, outfile)
print "done"