17 lines
1.6 KiB
Plaintext
17 lines
1.6 KiB
Plaintext
from pathlib import Path
|
|
import json,hashlib,subprocess,datetime
|
|
R=Path.cwd();F=R/'docs/hel-892/scail-reference';rows=json.loads((F/'sources.json').read_bytes())['sources'];now=datetime.datetime.now(datetime.timezone.utc).isoformat()
|
|
def add(key,files):
|
|
proto=next(e for e in rows if e['id']==key);cache=R/('.local-evidence/scail-'+key+'-git');tree=json.loads((F/(key+'-tree.json')).read_bytes())['tree']
|
|
for file in files:
|
|
if any(e['id']==key and e['file']==file for e in rows):continue
|
|
ent=next((e for e in tree if e['path']==file),None)
|
|
if not ent:print('MISSING',key,file);continue
|
|
raw=subprocess.check_output(['git','-C',str(cache),'show',proto['commit']+':'+file],timeout=80);assert len(raw)<3000000;local=key+'__'+file.replace('/','__');(F/local).write_bytes(raw)
|
|
rows.append(dict(proto,file=file,local_file=local,sha256=hashlib.sha256(raw).hexdigest(),git_blob_sha1=ent['sha'],acquisition_time=now,reverified_at=now,url=f"https://raw.githubusercontent.com/{proto['repo']}/{proto['commit']}/{file}"));print('ADD',key,file)
|
|
add('frontend',['src/core/graph/subgraph/resolveConcretePromotedWidget.ts','src/core/schemas/promotionSchema.ts','src/composables/node/canvasImagePreviewTypes.ts','src/extensions/core/uploadImage.ts'])
|
|
add('core0240',['comfy_api/latest/_input/video_types.py','comfy_api/latest/_input_impl/video_types.py','comfy_api/latest/_util/video_types.py'])
|
|
add('core0271',['comfy_api/latest/_input/video_types.py','comfy_api/latest/_input_impl/video_types.py'])
|
|
add('core0193',['comfy/sd.py','comfy/model_detection.py'])
|
|
(F/'sources.json').write_text(json.dumps(dict(sources=rows),ensure_ascii=False,indent=2)+'\n');print('ROWS',len(rows))
|