|
1 |
| -#!/usr/bin/env python3 |
| 1 | +#!/usr/bin/env python2.7 |
2 | 2 |
|
3 | 3 | """
|
4 | 4 | This script updates only market/item icons.
|
|
11 | 11 | import sqlite3
|
12 | 12 |
|
13 | 13 | from PIL import Image
|
14 |
| - |
| 14 | +from shutil import copyfile |
15 | 15 |
|
16 | 16 | parser = argparse.ArgumentParser(description='This script updates module icons for pyfa')
|
17 | 17 | parser.add_argument('-e', '--eve', required=True, type=str, help='path to eve\'s ')
|
|
73 | 73 | resfileindex = file_index['app:/resfileindex.txt']
|
74 | 74 |
|
75 | 75 | res_cache = os.path.join(args.eve, 'ResFiles')
|
| 76 | + |
76 | 77 | with open(os.path.join(res_cache, resfileindex[1]), 'r') as f:
|
77 | 78 | lines = f.readlines()
|
78 | 79 | res_index = {x.split(',')[0].lower(): x.split(',') for x in lines}
|
79 | 80 |
|
80 |
| -for x in res_index: |
81 |
| - if x.startswith('res:/ui/texture/icons/ammo/'): |
82 |
| - print(x) |
| 81 | +# Need to copy the file to our cuirrent directory |
| 82 | +graphics_loader_file = os.path.join(res_cache, file_index['app:/bin/graphicIDsLoader.pyd'][1]) |
| 83 | +to_path = os.path.dirname(os.path.abspath(__file__)) |
| 84 | +copyfile(graphics_loader_file, os.path.join(os.path.dirname(os.path.abspath(__file__)), 'graphicIDsLoader.pyd')) |
| 85 | + |
| 86 | +# The loader expect it to be the correct filename, so copy trhe file as well |
| 87 | +graphics_file = os.path.join(res_cache, res_index['res:/staticdata/graphicIDs.fsdbinary'.lower()][1]) |
| 88 | +to_path = os.path.dirname(os.path.abspath(__file__)) |
| 89 | +copyfile(graphics_file, os.path.join(os.path.dirname(os.path.abspath(__file__)), 'graphicIDs.fsdbinary')) |
| 90 | + |
| 91 | +import graphicIDsLoader |
| 92 | + |
| 93 | +print(dir(graphicIDsLoader)) |
| 94 | + |
| 95 | +graphics = graphicIDsLoader.load(os.path.join(to_path, 'graphicIDs.fsdbinary')) |
| 96 | + |
| 97 | +graphics_py_ob = {} |
| 98 | +for x, v in graphics.items(): |
| 99 | + if (hasattr(v, 'iconFolder')): |
| 100 | + graphics_py_ob[x] = v.iconFolder |
83 | 101 |
|
84 | 102 | # Add children to market group list
|
85 | 103 | # {parent: {children}}
|
|
0 commit comments