Fix icon logic / add some missing icons
BIN
imgs/icons/burstprojectorecm.png
Normal file
|
After Width: | Height: | Size: 869 B |
BIN
imgs/icons/burstprojectorenergyneutralization.png
Normal file
|
After Width: | Height: | Size: 858 B |
BIN
imgs/icons/burstprojectorsensordampening.png
Normal file
|
After Width: | Height: | Size: 854 B |
BIN
imgs/icons/burstprojectorstasiswebification.png
Normal file
|
After Width: | Height: | Size: 911 B |
BIN
imgs/icons/burstprojectortargetillumination.png
Normal file
|
After Width: | Height: | Size: 897 B |
BIN
imgs/icons/burstprojectortrackingdisruption.png
Normal file
|
After Width: | Height: | Size: 880 B |
BIN
imgs/icons/burstprojectorwarpdisruption.png
Normal file
|
After Width: | Height: | Size: 868 B |
BIN
imgs/icons/emergencyhullenergizer.png
Normal file
|
After Width: | Height: | Size: 597 B |
BIN
imgs/icons/icon_fireworks.png
Normal file
|
After Width: | Height: | Size: 968 B |
BIN
imgs/icons/marketicon_amarr.png
Normal file
|
After Width: | Height: | Size: 602 B |
BIN
imgs/icons/marketicon_caldari.png
Normal file
|
After Width: | Height: | Size: 462 B |
BIN
imgs/icons/marketicon_gallente.png
Normal file
|
After Width: | Height: | Size: 730 B |
BIN
imgs/icons/marketicon_minmatar.png
Normal file
|
After Width: | Height: | Size: 638 B |
BIN
imgs/icons/remote_repair.png
Normal file
|
After Width: | Height: | Size: 750 B |
BIN
imgs/icons/remote_repairer.png
Normal file
|
After Width: | Height: | Size: 748 B |
@@ -23,6 +23,7 @@ db_path = os.path.abspath(os.path.join(script_dir, '..', 'eve.db'))
|
||||
icons_dir = os.path.abspath(os.path.join(script_dir, '..', 'imgs', 'icons'))
|
||||
export_dir = os.path.abspath(os.path.expanduser(os.path.join(args.icons, 'items')))
|
||||
|
||||
dirs = [export_dir, os.path.join(export_dir, "Modules")]
|
||||
|
||||
db = sqlite3.connect(db_path)
|
||||
cursor = db.cursor()
|
||||
@@ -150,21 +151,20 @@ for fname in os.listdir(icons_dir):
|
||||
print fname,"exists"
|
||||
existing.add(fname)
|
||||
|
||||
|
||||
for fname in os.listdir(export_dir):
|
||||
if not os.path.isfile(os.path.join(export_dir, fname)):
|
||||
continue
|
||||
stripped = strip_path(fname)
|
||||
stripped = unzero(stripped)
|
||||
# Icons in export often specify size in their name, but references often use
|
||||
# convention without size specification
|
||||
sizeless = re.sub('^(?P<prefix>[^_]+)_(?P<size>\d+)_(?P<suffix>[^_]+)$', r'\1_\3', stripped)
|
||||
# Often items referred to with 01_01 format,
|
||||
fnames = export.setdefault(stripped, set())
|
||||
fnames.add(fname)
|
||||
fnames = export.setdefault(sizeless, set())
|
||||
fnames.add(fname)
|
||||
|
||||
for dir in dirs:
|
||||
for fname in os.listdir(dir):
|
||||
if not os.path.isfile(os.path.join(dir, fname)):
|
||||
continue
|
||||
stripped = strip_path(fname)
|
||||
stripped = unzero(stripped)
|
||||
# Icons in export often specify size in their name, but references often use
|
||||
# convention without size specification
|
||||
sizeless = re.sub('^(?P<prefix>[^_]+)_(?P<size>\d+)_(?P<suffix>[^_]+)$', r'\1_\3', stripped)
|
||||
# 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
|
||||
@@ -195,10 +195,13 @@ def get_icon_file(request):
|
||||
return None
|
||||
# {(h, w): source full path}
|
||||
sizes = {}
|
||||
for fname in fnames:
|
||||
fullpath = os.path.join(export_dir, fname)
|
||||
img = Image.open(fullpath)
|
||||
sizes[img.size] = fullpath
|
||||
for dir in dirs:
|
||||
for fname in fnames:
|
||||
fullpath = os.path.join(dir, fname)
|
||||
if not os.path.isfile(fullpath):
|
||||
continue
|
||||
img = Image.open(fullpath)
|
||||
sizes[img.size] = fullpath
|
||||
# Try to return image which is already in necessary format
|
||||
try:
|
||||
fullpath = sizes[ICON_SIZE]
|
||||
|
||||
@@ -204,6 +204,8 @@ def main(db, json_path):
|
||||
split = row['iconFile'].split('_')
|
||||
if len(split) == 3:
|
||||
row['iconFile'] = "{}_{}".format(split[0], split[2])
|
||||
if jsonName is "icons" and "modules/" in str(row["iconFile"]).lower():
|
||||
row["iconFile"] = row["iconFile"].lower().replace("modules/", "").replace(".png", "")
|
||||
|
||||
for k, v in row.iteritems():
|
||||
setattr(instance, fieldMap.get(k, k), v)
|
||||
|
||||