wangrong
2026-08-24 beef6536e7c8dd3f5cbe8f73585611479910bea7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
o
þ43j ã@spddlZddlZddlZddlmZddlmZddlmZm    Z    ddl
m Z e  e ¡Ze    dZGdd„dƒZdS)    éN)ÚPath)ÚLock)ÚAnyÚLiteral)Úsettings)ÚautoÚmanualc @s
eZdZddedBddfdd„Zdeeeffdd„Zddd    „Z    d
ede
fd d „Z         dd
ed e dedBde dBde
f
dd„Z        dd
ed e dedBde dBddf
dd„Zd
ede
fdd„Zdeeeffdd„Zd
edeeefdBfdd„Zd
edede
fdd„ZdS) Ú InitRegistryNÚ storage_pathÚreturncCs"|ptj|_tƒ|_| ¡|_dS©N)rÚ!resolved_initialized_devices_filer
rÚ_lockÚ_loadÚ_data)Úselfr
©rú:D:\apps\smartlearning\server\app\services\init_registry.pyÚ__init__s zInitRegistry.__init__cCsJ|j ¡r!|jjdd }t |¡WdƒS1swYdiiS)Núutf-8©ÚencodingÚdevices)r
ÚexistsÚopenÚjsonÚload©rÚfrrrrs
 
 ÿzInitRegistry._loadcCs\|jjjddd|jjddd}tj|j|dddWdƒdS1s'wYdS)    NT)ÚparentsÚexist_okÚwrrFé)Ú ensure_asciiÚindent)r
ÚparentÚmkdirrrÚdumprrrrrÚ_saves"ÿzInitRegistry._saveÚ    device_idcCs8|j||jdvWdƒS1swYdS©Nr)rr©rr)rrrÚis_initialized ó $ÿzInitRegistry.is_initializedÚsourceÚmodeÚ    timestampcCsx|j/||jdvr    WdƒdS|ptt ¡ƒ||dœ|jd|<| ¡    WdƒdS1s5wYdS)NrF©Zinitialized_atr.r/T)rrÚintÚtimer(©rr)r.r/r0rrrÚ    try_claim$sþý$÷zInitRegistry.try_claimcCsV|j|p tt ¡ƒ||dœ|jd|<| ¡WdƒdS1s$wYdS)Nr1r)rr2r3rr(r4rrrÚmark_initialized6sý
"úzInitRegistry.mark_initializedcCsb|j$||jdvr    WdƒdS|jd|=| ¡    WdƒdS1s*wYdS©NrFT)rrr(r+rrrÚremoveEsþ $ûzInitRegistry.removecCs8|jt|jdƒWdƒS1swYdSr*)rÚdictr)rrrrÚlist_initializedMr-zInitRegistry.list_initializedcCsJ|j|jd |¡}|rt|ƒndWdƒS1swYdSr*)rrÚgetr9)rr)ÚrecordrrrÚ
get_recordQs$þzInitRegistry.get_recordÚfieldscKsj|j(||jdvr    WdƒdS|jd| |¡| ¡    WdƒdS1s.wYdSr7)rrÚupdater()rr)r>rrrÚ update_recordVsþ$ûzInitRegistry.update_recordr )r N)NN)Ú__name__Ú
__module__Ú __qualname__rrr9Ústrrrr(Úboolr,Ú
InitSourcer2r5r6r8r:r=r@rrrrr    sF
ûþýüû
úûþýüû
úr    )rÚloggingr3ÚpathlibrÚ    threadingrÚtypingrrÚ
app.configrÚ    getLoggerrAÚloggerrFr    rrrrÚ<module>s