ó
    Eñi­  ã                   ó¦   • S r SSKrSSKrSSKr\R                  R                  \R                  R                  \5      5      rSr	S r
SS jrSS jrg)zEThis module contains generic code to find and load a dynamic library.é    NFc                 ó0  • U R                  5       n [        R                  R                  S5      (       a  U R	                  S5      $ [        R                  R                  S5      (       a  U R	                  S5      $ U R	                  S5      =(       d    SU ;   $ )z{Returns True if the given filename looks like a dynamic library.
Based on extension, but cross-platform and more flexible.
Úwinz.dllÚdarwinz.dylibz.soz.so.)ÚlowerÚsysÚplatformÚ
startswithÚendswith)Úfnames    ÚQ/home/mande/repo/quber/.venv/lib/python3.13/site-packages/imageio/core/findlib.pyÚ	looks_libr      so   € ð �K‰K‹M€EÜ
‡|�|×Ñ˜u×%Ñ%Ø�~‰~˜fÓ%Ð%Ü	�‰×	 Ñ	  ×	*Ñ	*Ø�~‰~˜hÓ'Ð'à�~‰~˜eÓ$×7¨°%©Ð7ó    c           	      ó¦  • U=(       d    / n/ SQn/ SQnU Vs/ s H1  n[         R                  R                  [        R                  U5      PM3     nn[        [        S5      (       aA  XS Vs/ s H1  n[         R                  R                  [        R                  U5      PM3     sn-  n[         R                  R                  S5      nS Vs/ s H"  n[         R                  R                  Xd5      PM$     nnX-   U-   U-   n/ nU HA  n	[         R                  R                  U	5      (       d  M)  X‘;  d  M0  UR                  U	5        MC     / n
U H³  n[         R                  " U5      n[        [        U5      5      n[        U[        S9nU  Hr  nU Hi  nUR                  5       R                  U5      (       d  M)  [!        U5      (       d  M;  U
R                  [         R                  R                  X¾5      5        Mk     Mt     Mµ     U
 Vs/ s H+  n[         R                  R#                  U5      (       d  M)  UPM-     n
nX4$ s  snf s  snf s  snf s  snf )z–Generate a list of candidate filenames of what might be the dynamic
library corresponding with the given list of names.
Returns (lib_dirs, lib_paths)
)z/libz/usr/libz/usr/lib/x86_64-linux-gnuz/usr/lib/aarch64-linux-gnuz/usr/local/libz/opt/local/lib)ÚbinÚlibÚDLLszLibrary/binÚsharedÚbase_prefixÚ~)r   )Úkey)ÚosÚpathÚjoinr   ÚprefixÚhasattrr   Ú
expanduserÚisdirÚappendÚlistdirÚreversedÚsortedÚlenr   r	   r   Úisfile)Ú	lib_namesÚlib_dirsÚsys_lib_dirsÚpy_sub_dirsÚdÚpy_lib_dirsÚhome_dirÚuser_lib_dirsÚpotential_lib_dirsÚldÚ	lib_pathsÚlib_dirÚfilesÚlib_namer   Úlps                   r   Úgenerate_candidate_libsr3      sÆ  € ð
 �~˜2€Hò€Lò B€KÙ8CÓDº°1”2—7‘7—<‘<¤§
¡
¨AÖ.¹€KÐDÜŒs�M×"Ñ"ØÀ+ÓNÂ+¸QœŸ™Ÿ™¤S§_¡_°aÖ8Á+ÑNÑNˆô �w‰w×!Ñ! #Ó&€HÙ8?Ó@º°1”R—W‘W—\‘\ (Ö.¹€MÐ@ð "Ñ0°;Ñ>ÀÑNÐØ€HÛ ˆÜ�7‰7�=‰=˜×Ó Õ!3Ø�O‰O˜BÖñ !ð €IÛˆä—
’
˜7Ó#ˆÜœ ›Ó'ˆÜ�u¤#Ñ&ˆÛ!ˆHã�Ø—;‘;“=×+Ñ+¨H×5Ó5¼)ÀE×:JÓ:JØ×$Ñ$¤R§W¡W§\¡\°'Ó%AÖBó ó "ñ ñ (Ó>ši˜¬2¯7©7¯>©>¸"×+=—™i€IÐ>ØÐÐùò? EùâNùò Aùò0 ?s   ˜8H?Á+8IÃ)I	È(IÈ4Ic           	      ó¾  • [        U [        5      (       d   e[        U[        5      (       d   eUb  [        U[        5      (       d   eU  Vs/ s H  o3(       d  M  UPM     n nU Vs/ s H  o3(       d  M  UPM     nnU(       a  US   nOU (       a  U S   nO[        S5      e[        (       a  / / pRO[	        X5      u  p%X-   n[
        R                  R                  S5      (       a  [        R                  nO[        R                  nSn/ nU H  n	 UR                  U	5      n  O   Ucm  U(       aF  U VVs/ s H  u  p¼U< S[        U5      < 3PM     nnnSn[        XäSR!                  U5      4-  5      eSn[        XäS	R!                  U5      4-  5      eUW	4$ s  snf s  snf ! [         a(  n
X�;  a  UR                  Xš45         Sn
A
M¾   Sn
A
MÄ  Sn
A
ff = fs  snnf )
aµ  load_lib(exact_lib_names, lib_names, lib_dirs=None)

Load a dynamic library.

This function first tries to load the library from the given exact
names. When that fails, it tries to find the library in common
locations. It searches for files that start with one of the names
given in lib_names (case insensitive). The search is performed in
the given lib_dirs and a set of common library dirs.

Returns ``(ctypes_library, library_path)``
Nr   zNo library name given.r   z:
z\One or more %s libraries were found, but could not be loaded due to the following errors:
%sz

z)Could not find a %s library in any of:
%sÚ
)Ú
isinstanceÚlistÚ
ValueErrorÚSYSTEM_LIBS_ONLYr3   r   r   r	   ÚctypesÚwindllÚcdllÚLoadLibraryÚ	Exceptionr   ÚstrÚOSErrorr   )Úexact_lib_namesr$   r%   ÚnÚthe_lib_namer.   ÚloaderÚthe_libÚerrorsr   Úerrr   ÚeÚerr_txtÚmsgs                  r   Úload_librK   S   sÕ  € ô �o¤t×,Ñ,Ð,Ð,Ü�i¤×&Ñ&Ð&Ð&ØÑÜ˜(¤D×)Ñ)Ð)Ð)Ù"1Ó7¢/˜Q³Q—q¡/€OÐ7Ù%Ó+šI�q«—™I€IÐ+ö Ø  ‘|‰Þ	Ø& qÑ)‰äÐ1Ó2Ð2÷
 ÒØ  "‘)ä5°iÓJÑˆØÑ+€Iô ‡|�|×Ñ˜u×%Ñ%Ü—‘‰ä—‘ˆð €GØ€FÛˆð	,Ø×(Ñ(¨Ó/ˆGÙñ ð �Þñ @FÔFºv±V°S£C¬¨Q­Ó0¹vˆGÑFðIð ô ˜#¨v¯{©{¸7Ó/CÐ DÑDÓEÐEð ?ˆCÜ˜#¨t¯y©y¸Ó/BÐ CÑCÓDÐDð �Eˆ>Ðùòs 8ùÚ+øô@ ó 	,ð Ó+Ø—‘˜u˜l×+Ò+õ ,ûð		,üó Gs6   Á
FÁFÁ'
FÁ5FÄF$Ä5GÆ$
GÆ.GÇG)N)Ú__doc__r   r   r:   r   ÚabspathÚdirnameÚ__file__ÚLOCALDIRr9   r   r3   rK   © r   r   Ú<module>rR      sL   ðñ
 Lã 	Û 
Û à�7‰7�?‰?˜2Ÿ7™7Ÿ?™?¨8Ó4Ó5€ð Ð ò
8ô2õjLr   