r4i<ddlZddlmZ ddlZddlZddlmZddlm Z da da ejdZ dZdZdZd efd Zd ej&fd Zd ej&fd Zy#e$rddlZYawxYw) N)datetime)utils)win_tztzlocalci}tj|d}t|D]#}tj||}|d||d<%|S)z0Convert a registry key's values to a dictionary.r)winreg QueryInfoKeyrange EnumValue)keyresultsizeidatas Y/mnt/ssd/data/python-lab/DaemonControl/venv/lib/python3.12/site-packages/tzlocal/win32.py valuestodictrsY F   s #A &D 4["Q'q'tAw" Mcdx}}d}tjj}t|ddt|ddfD]F}|j|j dk(r |j |j }Ed}H|||fS)NFrgT)rnowyeardst total_seconds utcoffset)tz dst_offset std_offsethas_dstrdts r _get_dst_infor!s""JG <<>  Da#XdAq%9: 66": # # % ,b)779JG  J **rctj}|r|Stjdt j dtj }d}t j||}t|}|jd|vr|djddd}n tdtj|}|tj|dz}|tj||jd ddk(rjtj |}t#|\}} } |s|S| tj|d | d zrtjd |d d| d zdS|S)Nz'Looking up time zone info from registryz4SYSTEM\CurrentControlSet\Control\TimeZoneInformationTimeZoneKeyNamerrz+Can not find Windows timezone configurationz Standard TimeDynamicDaylightTimeDisabledz$ claims to not have a non-DST time!?iz+tzlocal can't support disabling DST in the z zone.zEtc/GMTz+.0f)r_tz_name_from_envlogdebugr ConnectRegistryHKEY_LOCAL_MACHINEOpenKeyrClosesplit LookupErrorrgetzoneinfoZoneInfoNotFoundErrorZoneInfor!) tzenvhandleTZLOCALKEYNAMElocaltz keyvalues tzkeynametimezonerrrrs r_get_localzone_namer:-s  # # %E  II78  # #D&*C*C DFLNnnV^4GW%I MMOI% /066vqA!D GHHzz)$H::i*::;,,Y77}}2A6!;  x (*7*;'ZO  00+AB   00=hZvN  *d*4011 Orreturnc.t tatS)zLGet the zoneinfo timezone name that matches the Windows-configured timezone.)_cache_tz_namer:rrget_localzone_namer?ps,. rcttjtat j st j tdtS)zVReturns the zoneinfo-based tzinfo object that matches the Windows-configured timezone.Ferror) _cache_tzr0r2r?rr&assert_tz_offsetr>rr get_localzonerEysB%%&8&:;  " " $ y6 rctatjtat j tdtS)zOReload the cached localzone. You need to call this if the timezone has changed.FrA)r:r=r0r2rCrrDr>rrreload_localzonerGs2)*N!!.1I 9E2 r)loggingr_winregr ImportErrorr0rrtzlocal.windows_tzrrCr= getLoggerr'rr!r:strr?r2rErGr>rrrNs%  g " +@FC x((  (++GsA&& A21A2