Changeset View
Changeset View
Standalone View
Standalone View
source/blender/datatoc/datatoc_icon.py
| Show First 20 Lines • Show All 105 Lines • ▼ Show 20 Lines | |||||
| def icondir_to_png(path_src, file_dst): | def icondir_to_png(path_src, file_dst): | ||||
| """ Takes a path full of 'dat' files and writes out | """ Takes a path full of 'dat' files and writes out | ||||
| """ | """ | ||||
| import os | import os | ||||
| import array | import array | ||||
| files = [os.path.join(path_src, f) for f in os.listdir(path_src) if f.endswith(".dat")] | files = [os.path.join(path_src, f) for f in sorted(os.listdir(path_src)) if f.endswith(".dat")] | ||||
| # First check if we need to bother. | # First check if we need to bother. | ||||
| if os.path.exists(file_dst): | if os.path.exists(file_dst): | ||||
| dst_time = os.path.getmtime(file_dst) | dst_time = os.path.getmtime(file_dst) | ||||
| has_newer = False | has_newer = False | ||||
| for f in files: | for f in files: | ||||
| if os.path.getmtime(f) > dst_time: | if os.path.getmtime(f) > dst_time: | ||||
| has_newer = True | has_newer = True | ||||
| ▲ Show 20 Lines • Show All 43 Lines • Show Last 20 Lines | |||||