directory separator appropriate for exec env (#1250)

Co-authored-by: aurelien.bailly <aurelien.bailly@destiny.eu>
This commit is contained in:
aurelienbyi 2023-04-01 21:44:41 +02:00 committed by GitHub
parent 4fbea7c425
commit ad8ad1589e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -59,13 +59,9 @@ def _get_image_files():
"""
ret = []
for f in sorted(glob.glob(f"elevation-images/*/*", recursive=True)):
# f = 'elevation-images/Nokia/nokia-7220-ixr-h3.front.png'
# f.split('/')[1] = Nokia
assert f.split('/')[2].split('.')[-1] in IMAGE_FILETYPES, f"Invalid file extension: {f}"
ret.append((f.split('/')[1], f))
for f in sorted(glob.glob(f"elevation-images{os.path.sep}*{os.path.sep}*", recursive=True)):
assert f.split(os.path.sep)[2].split('.')[-1] in IMAGE_FILETYPES, f"Invalid file extension: {f}"
ret.append((f.split(os.path.sep)[1], f))
return ret