Files
projects_stats/populate_args_with_all_project_folders.py

54 lines
1.6 KiB
Python

# This scripts parse 'TRAVAIL_VIDEO' to write all the project folders into args.json
import os
import json
folders_list = []
### CLIPS
if True:
root_path = os.path.join("G:\\_PRO\\CLIPS")
folders_list += [ f.path for f in os.scandir(root_path) if f.is_dir() and not f.name.startswith('_')]
folders_list += [ f.path for f in os.scandir(
os.path.join(root_path, "_ARCHIVES (EXPORTS SEULS)")
) if f.is_dir()]
### COMMERCIAL
if True:
root_path = os.path.join("G:\\_PRO\\COMMERCIAL")
prods = [ f.name for f in os.scandir(root_path) if f.is_dir() and not f.name.startswith('_')]
for prod_name in prods:
folders_list += [f.path for f in os.scandir(os.path.join(root_path, prod_name)) if f.is_dir()]
### DOCU
if True:
root_path = os.path.join("G:\\_PRO\\DOCU")
prods = [ f.name for f in os.scandir(root_path) if f.is_dir() and not f.name.startswith('_')]
for prod_name in prods:
folders_list += [f.path for f in os.scandir(os.path.join(root_path, prod_name)) if f.is_dir()]
### FICTIONS
if True:
root_path = os.path.join("G:\\_PRO\\FICTIONS")
prods = [ f.name for f in os.scandir(root_path) if f.is_dir() and not f.name.startswith('_')]
for prod_name in prods:
folders_list += [f.path for f in os.scandir(os.path.join(root_path, prod_name)) if f.is_dir()]
### WEB
if True:
root_path = os.path.join("G:\\_PRO\\WEB")
folders_list += [ f.path for f in os.scandir(root_path) if f.is_dir() and not f.name.startswith('_')]
# Write args.json
data = {}
data['folder_paths'] = folders_list
with open('args.json', 'w') as file:
file.write(json.dumps(data, indent=4))