o4i8ddlZGddeZGddeZy)Nc"eZdZdZdZdZdZy) IconCachezzMaintain a cache of icons. If an icon is used more than once by a GUI then ensure that only one copy is created. c<||_||_d|_g|_y)zInitialise the cache.N)_object_factory _qtgui_module _base_dir_cache)selfobject_factory qtgui_modules `/mnt/ssd/data/python-lab/DaemonControl/venv/lib/python3.12/site-packages/PyQt6/uic/icon_cache.py__init__zIconCache.__init__s" .) c||_y)z? Set the base directory to be used for all relative filenames. N)r )r base_dirs r set_base_dirzIconCache.set_base_dir's "rc,|jjd}|}|jdr1|j}|j dD]}t ||}|}n|j j|}|j jdd|fdS|jyt||j} |jj|}|d k\r|j|}|j&Sd}t|j}|d kDr|t!|z }|j jd |d }|j#||j|jj%||j&S#t$rd }YwxYw) z2Return an icon described by the given iconset tag.themeNzQIcon::ThemeIconz::zQIcon.fromThemeiconF) ctor_args is_attributerQIcon)r)attribget startswithrsplitgetattrrasStringcreateQtObjecttext_IconSetr r index ValueErrorlenstrset_iconappendr)r iconsetrobjnameisetidxrs rget_iconzIconCache.get_icon,s""7+   23((!KK--D!#t,C-,,55e<''667Huie7E E << 0 ++##D)C !8;;s#DyyDdkk"CQwC ''66w!&7(D MM$ 2 2 3 KK  t $yy' C s?F FFN)__name__ __module__ __qualname____doc__rrr/rrrrs" /rrc2eZdZdZdZedZdZdZy)r#zAAn icon set, ie. the mode and state and the pixmap used for each.c|j|j||_d|_i|_|D]B}|j}||j||}||j|j <d|_Dd|_y)z(Initialise the icon set from an XML tag.TNF) _file_namer" _fallback _use_fallback_rolestagr)r r*ri file_names rrz_IconSet.__init__as|x@!  'AI$ OOIx@ !*DKK !&D   ' rc|jdd}|dk7rG|ddk7r?tjj|s tjj ||}|S)z: Convert a relative filename if we have a base directory. \z\\rr:)replaceospathisabsjoin)fnamers rr7z_IconSet._file_namevsM dF+ r>eAh#obggmmE6JGGLL51E rcz|jr#|j|j||_y|jj D]\}}|j dr&|dd}|j jj}n8|j dr&|dd}|j jj}nut|j j|j}|r#|j|j||||j|j||||_y)z%Save the icon and set its attributes.offNon)r9addFiler8r:itemsendswithrStateOffOnrModetitle addPixmapQPixmapr)r rr rolepixmapmodestates rr(z_IconSet.set_icons    LL (& #!% 1 1 3 H f=='9D(..4488E]]4(9D(..4477E|1166 ENN<#7#7#?uMNN<#7#7#94G H" rct|t|stS|jr&|jr|j|jk(Sy|jry|j |j k(S)z#Compare two icon sets for equality.F) isinstancetypeNotImplementedr9r8r:)r others r__eq__z_IconSet.__eq__s_%d,! !   ""~~88   {{ell**rN) r0r1r2r3r staticmethodr7r(r_r4rrr#r#^s(K*2+rr#)os.pathrBobjectrr#r4rrrcs'.AAHK+vK+r