mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-06-05 15:48:45 +00:00
rename resource collector script and move it to scripts
This commit is contained in:
parent
7195e1d12f
commit
ea3bd0b6f8
@ -3,7 +3,11 @@ import os
|
|||||||
|
|
||||||
resources = {}
|
resources = {}
|
||||||
|
|
||||||
|
os.chdir('..')
|
||||||
|
|
||||||
def process_file(name):
|
def process_file(name):
|
||||||
|
if name.endswith('.gitignore'):
|
||||||
|
return
|
||||||
if name.endswith('.py'):
|
if name.endswith('.py'):
|
||||||
return
|
return
|
||||||
with open(name, 'rb') as f:
|
with open(name, 'rb') as f:
|
||||||
@ -16,10 +20,13 @@ for res in os.scandir('src/trezor/res/'):
|
|||||||
|
|
||||||
# scan apps
|
# scan apps
|
||||||
for app in os.scandir('src/apps/'):
|
for app in os.scandir('src/apps/'):
|
||||||
if app.is_dir():
|
if app.is_dir() and os.path.isdir('src/apps/%s/res/' % app.name):
|
||||||
for res in os.scandir('src/apps/%s/res/' % app.name):
|
for res in os.scandir('src/apps/%s/res/' % app.name):
|
||||||
if res.is_file():
|
if res.is_file():
|
||||||
process_file('src/apps/%s/res/%s' % (app.name, res.name))
|
process_file('src/apps/%s/res/%s' % (app.name, res.name))
|
||||||
|
|
||||||
with open('src/trezor/res/resources.py', 'wt') as f:
|
with open('src/trezor/res/resources.py', 'wt') as f:
|
||||||
f.write('resdata = ' + str(resources))
|
f.write('resdata = {\n')
|
||||||
|
for k in sorted(resources.keys()):
|
||||||
|
f.write(" '%s': %s,\n" % (k, resources[k]))
|
||||||
|
f.write('}\n')
|
Loading…
Reference in New Issue
Block a user