Files
aigc-home/docs/hel-892/director-pv-document-evidence/fetch-pv-widgets.py.txt
T

13 lines
1.1 KiB
Plaintext

from pathlib import Path
import json,datetime,subprocess,hashlib
R=Path.cwd();REF=R/'docs/hel-892/director-pv-reference';now=datetime.datetime.now(datetime.timezone.utc).isoformat()
s=Path('.local-evidence/setup-director-pv.py').read_text();fragment=Path('.local-evidence/setup-anima.py').read_text();fragment=fragment[fragment.index('def fetch(spec):'):fragment.index('with concurrent.futures.ThreadPoolExecutor')].replace('anima-','director-pv-');exec(fragment)
rows=json.loads((REF/'sources.json').read_bytes())['sources']
for key,repo,rev,files in [('easy','yolain/ComfyUI-Easy-Use','595e0738a9e3f8d0d9c4d875461b2d2c9e7559c7',['web_version/v1/js/easy/easyWidgets.js'])]:
p=REF/(key+'-fetch.txt')
if p.exists():(REF/(key+'-fetch-prior-widgets-step.txt')).write_bytes(p.read_bytes())
rows+=fetch((key,repo,rev,files))
for e in rows:
if e['license_file']==e['id']+'__LICENSE'and not (REF/e['license_file']).exists():e['license_file']=next(x['local_file']for x in rows if x['id']==e['id']and x['file']=='LICENSE')
(REF/'sources.json').write_text(json.dumps(dict(sources=rows),ensure_ascii=False,indent=2)+'\n')