mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-01-11 16:00:57 +00:00
res_collect now works also on CPython<3.5
This commit is contained in:
parent
0637987c09
commit
44479b38d0
@ -15,16 +15,19 @@ def process_file(name):
|
|||||||
resources[name] = f.read()
|
resources[name] = f.read()
|
||||||
|
|
||||||
# scan common resources
|
# scan common resources
|
||||||
for res in os.scandir('trezor/res/'):
|
for res in os.listdir('trezor/res/'):
|
||||||
if res.is_file():
|
name = os.path.join('trezor/res/', res)
|
||||||
process_file('trezor/res/%s' % res.name)
|
if os.path.isfile(name):
|
||||||
|
process_file(name)
|
||||||
|
|
||||||
# scan apps
|
# scan apps
|
||||||
for app in os.scandir('apps/'):
|
for app in os.listdir('apps/'):
|
||||||
if app.is_dir() and os.path.isdir('apps/%s/res/' % app.name):
|
name = os.path.join('apps/', app)
|
||||||
for res in os.scandir('apps/%s/res/' % app.name):
|
if os.path.isdir(name) and os.path.isdir('apps/%s/res/' % app):
|
||||||
if res.is_file():
|
for res in os.listdir('apps/%s/res/' % app):
|
||||||
process_file('apps/%s/res/%s' % (app.name, res.name))
|
name = 'apps/%s/res/%s' % (app, res)
|
||||||
|
if os.path.isfile(name):
|
||||||
|
process_file(name)
|
||||||
|
|
||||||
resfile = 'trezor/res/resources.py'
|
resfile = 'trezor/res/resources.py'
|
||||||
with open(resfile, 'wt') as f:
|
with open(resfile, 'wt') as f:
|
||||||
|
Loading…
Reference in New Issue
Block a user