grthtrhthjhtyjytjytkergtrhtrjytjerhrfh4:24 29/09/2026o ®û|j4¤ã @sØdZdZdZddlZddlZddlZddlZddlZddlZddl Z ddddddd d d d d œ Z e  d ¡Z d d„Z e  dej¡Zd„dd„Zd…dd„Ze  d¡Z  d†dd„Zddddddd d!d"d#d$d%œ Zdd&d'd(d)d*d+œZd,d-„Zd.d/„Zd‡d0d1„Zd2d3„Zdˆd5d6„Zd7d8„Zd‰d9d:„Zd;d<„Zd=d>„Zd…d?d@„ZdAdB„Z d…dCdD„Z!dEdFdGdœZ"ej#ddfdHdI„Z$dJdK„Z%GdLdM„dMƒZ&dNdO„Z'GdPdQ„dQe (dRdS¡ƒZ)da*dTdU„Z+dVdW„Z,dXdY„Z-dZd[„Z.d\d]„Z/d^d_„Z0d`da„Z1e  dbej¡Z2e  dcej¡Z3e  dd¡Z4e  de¡Z5iZ6dŠdfdg„Z7dhdi„Z8djdk„Z9dldm„Z:dndo„Z;dpdq„ZiZ?d‹dvdw„Z@e  dx¡ZAe  dy¡ZBdzZCdaDd{d|„ZEd}d~„ZFeGdk�rjd€ejHv�pPd�ejHvZId‚ejHv�o[dƒejHvZJeKe@eJeIƒƒe Ld¡dSdS)Œa8 This module tries to retrieve as much platform-identifying data as possible. It makes this information available via function APIs. If called from the command line, it prints the platform information concatenated as single string to stdout. The output format is useable as part of a filename. a Copyright (c) 1999-2000, Marc-Andre Lemburg; mailto:mal@lemburg.com Copyright (c) 2000-2010, eGenix.com Software GmbH; mailto:info@egenix.com Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee or royalty is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation or portions thereof, including modifications, that you make. EGENIX.COM SOFTWARE GMBH DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE ! z1.0.8éNé ééé(é2éÈ) ZdevZalphaÚaZbetaÚbÚcZRCZrcÚplÚpz([0-9]+|[._+-])c Cs`g}t |¡D]&}|dvr-z t|dƒ}d}Wnty%t |d¡}Ynw| ||f¡q|S)Nz._+-rédr)Ú _component_reÚsplitÚintÚ ValueErrorÚ _ver_stagesÚgetÚextend)ÚversionÚresultÚvÚt©rú//opt/alt/python310/lib64/python3.10/platform.pyÚ_comparable_versionŽs  ÿ€rsC(__libc_init)|(GLIBC_([0-9.]+))|(libc(_\w+)?\.so(?:\.(\d[0-9.]*))?)Úé@c Cs|s*zt d¡}|jdd�}t|ƒdkrt|ƒWSWn tttfy&Ynwtj }t }t tj dƒr8tj   |¡}t|dƒ�À}| |¡}d} | t|ƒkréd|vsSd |vrZt || ¡} nd } | rf|  ¡t|ƒkr‚| |¡} | r|t| t|ƒd ƒd …| }d} qE| s‚nqd d „|  ¡Dƒ\} } }}}}| r˜|s˜d}n=| r®|dkr£d}|}n2||ƒ||ƒkr­|}n'|rÕ|dkrÕd}|rÄ|rÂ||ƒ||ƒkrÄ|}|rÕ|t|ƒ d …|krÕ||}|  ¡} | t|ƒksKWd ƒ||fSWd ƒ||fSWd ƒ||fS1�swY||fS)a Tries to determine the libc version that the file executable (which defaults to the Python interpreter) is linked against. Returns a tuple of strings (lib,version) which default to the given parameters in case the lookup fails. Note that the function has intimate knowledge of how different libc versions add symbols to the executable and thus is probably only useable for executables compiled using gcc. The file is read and scanned in chunks of chunksize bytes. ÚCS_GNU_LIBC_VERSIONé)ÚmaxsplitéÚrealpathÚrbrslibcsGLIBCNiècSs"g|] }|dur | d¡n|‘qS)NÚlatin1)Údecode)Ú.0ÚsrrrÚ Ôsÿÿzlibc_ver..ZlibcÚglibc)ÚosÚconfstrrÚlenÚtupleÚAttributeErrorrÚOSErrorÚsysÚ executablerÚhasattrÚpathr"ÚopenÚreadÚ _libc_searchÚsearchÚendÚmaxÚgroups)r1ÚlibrZ chunksizeÚverÚpartsÚVÚfZbinaryÚposÚmÚchunkZlibcinitr)Z glibcversionZsoZthreadsZ soversionrrrÚlibc_ver¢sx    ÿþ      þ€á ý#à ý#ì ñ#Ý#rCcCs^| d¡}|r | |¡z ttttt|ƒƒƒ}Wn ty#|}Ynwd |dd…¡}|S)zŒ Normalize the version and build strings and return a single version string using the format major.minor.build (or patchlevel). Ú.Né)rÚappendÚlistÚmapÚstrrrÚjoin)rÚbuildÚlZstringsrrrÚ _norm_versionés   ÿrMz'(?:([\w ]+) ([\w.]+) .*\[.* ([\d.]+)\])©Úwin32Úwin16Údosc Csätj|vr |||fSddl}dD]'}z|j||j|jddd�}Wnt|jfy5}zWYd}~qd}~wwn|||fS| ¡}t  |¡}|durm|  ¡\}}}|ddkr]|dd…}|ddkri|dd…}t |ƒ}|||fS)a+ Tries to figure out the OS version used and returns a tuple (system, release, version). It uses the "ver" shell command for this which is known to exists on Windows, DOS. XXX Others too ? In case this fails, the given parameters are used as defaults. rN)r<zcommand /c verz cmd /c verT)ÚstdinÚstderrÚtextÚshelléÿÿÿÿrD) r0ÚplatformÚ subprocessÚ check_outputÚDEVNULLr/ÚCalledProcessErrorÚstripÚ _ver_outputÚmatchr:rM) ÚsystemÚreleaserZsupported_platformsrXÚcmdÚinfoZwhyrArrrÚ _syscmd_vers6   ü €þ       rcZ2000ZXPZ 2003ServerZpost2003ÚVistaÚ7Ú8z8.1zpost8.1Z10Zpost10) )ér)rgr©rgr!)rgN©ér©rjr©rjr!©rjrE©rjN)rr)rNZ 2008ServerZ 2008ServerR2Z 2012ServerZ 2012ServerR2Zpost2012ServerR2)rhrirkrlrmrncCs tƒdvS)N)ZIoTUAPZ NanoServerZWindowsCoreHeadlessZ IoTEdgeOS)Ú win32_editionrrrrÚ win32_is_iotSs rpcCs¢zzddl}Wn tyddl}YnwWn ty YdSwz%d}| |j|¡�}| |d¡dWdƒWS1s?wYWdStyPYdSw)Nrú,SOFTWARE\Microsoft\Windows NT\CurrentVersionZ EditionId)ÚwinregÚ ImportErrorÚ_winregÚ OpenKeyExÚHKEY_LOCAL_MACHINEÚ QueryValueExr/)rrÚcvkeyÚkeyrrrroVs*   ÿ€  ö$ÿ ýýroc CsÞzddlm}Wnty||||fYSw|ƒ}ztttƒd d¡ƒ\}}}Wnty@|jp:|dd…\}}}Ynwd  |||¡}t   ||f¡pWt   |df¡pW|}|dd…||fkr„zd  |j ¡}Wnt yƒ|dd…d kr�d |dd…}Ynwt|d dƒdkrœt  ||f¡p›t  |df¡p›|}zzddl} Wn ty°ddl} YnwWn ty»Yn.wz#d } |  | j| ¡�} |  | d ¡d}Wdƒn1sÙwYWn tyèYnw||||fS)Nr)Úgetwindowsversionr!rDrEz {0}.{1}.{2}zSP{}é z Service Pack ZSPZ product_typerqZ CurrentType)r0rzrsrHrrcrrZplatform_versionÚformatÚ_WIN32_CLIENT_RELEASESrZservice_pack_majorr.ÚgetattrÚ_WIN32_SERVER_RELEASESrrrtrurvrwr/) r`rÚcsdÚptyperzÚwinverÚmajorÚminorrKrrrxryrrrÚ win32_verhsf ÿ  ÿ ÿþ €þ ÿþ   ÿ€ ÿÿ€ ÿ r…cCs–d}tj |¡s dSzddl}Wn tyYdSwt|dƒ� }| |¡}Wdƒn1s0wY|d}d}t ¡j}|dvrFd}|||fS)Nz0/System/Library/CoreServices/SystemVersion.plistrr#ZProductVersion©rrr)ZppczPower MacintoshZPowerPC) r*r3ÚexistsÚplistlibrsr4ÚloadÚunameÚmachine)Úfnrˆr?r r`Ú versioninfor‹rrrÚ _mac_ver_xml›s"   ÿ  ÿ  rŽr†cCstƒ}|dur |S|||fS)a< Get macOS version information and return it as tuple (release, versioninfo, machine) with versioninfo being a tuple (version, dev_stage, non_release_version). Entries which cannot be determined are set to the parameter values which default to ''. All tuple entries are strings. N)rŽ)r`r�r‹rbrrrÚmac_ver±s  r�cCsBddlm}z| |¡}|dur|WS|WSty |YSw)Nr)ÚSystem)Ú java.langr�Z getPropertyr.)ÚnameÚdefaultr�ÚvaluerrrÚ _java_getpropÄs   ÿr•c Cs°zddl}Wnty||||fYSwtd|ƒ}td|ƒ}|\}}}td|ƒ}td|ƒ}td|ƒ}|||f}|\}} } td| ƒ} td |ƒ}td | ƒ} || | f}||||fS) a] Version interface for Jython. Returns a tuple (release, vendor, vminfo, osinfo) with vminfo being a tuple (vm_name, vm_release, vm_vendor) and osinfo being a tuple (os_name, os_version, os_arch). Values which cannot be determined are set to the defaults given as parameters (which all default to ''). rNz java.vendorz java.versionz java.vm.namezjava.vm.vendorzjava.vm.versionz java.os.archz java.os.namezjava.os.version)r‘rsr•) r`ÚvendorÚvminfoÚosinfoÚjavaZvm_nameZ vm_releaseZ vm_vendorÚos_nameÚ os_versionÚos_archrrrÚjava_verÏs$  ÿ             r�cCs”|dkr?|dkr |||fS| d¡}|r5zt|dƒ}Wn ty%Ynw|d}t|ƒ|d<d |¡}|dkr"s€z_platform..ú Ú_ú/ú\ú:ú;ú"ú(ú)Úunknownrrz--rVN)rJÚfilterr,Úreplace)ÚargsrWZcleanedrrrÚ _platforms(          ü   ÿr´cCsFzddl}Wn ty|YSwz| ¡WSty"|YSw)z8 Helper to determine the node name of this machine. rN)ÚsocketrsZ gethostnamer/)r“rµrrrÚ_node<s  þ  þr¶cCsLtj |¡}tj |¡r$tj tj tj |¡t |¡¡¡}tj |¡s |S)zT In case filepath is a symlink, follow it until a real file is reached. )r*r3ÚabspathÚislinkÚnormpathrJÚdirnameÚreadlink)ÚfilepathrrrÚ_follow_symlinksKs  ÿ ÿr½c Csxtjdvr|Sddl}t|ƒ}ttjdd�}z|jdd|g|j|d�}Wnt |j fy2|YSw|s7|S|  d ¡S) zð Interface to the system's file command. The function uses the -b option of the file command to have it omit the filename in its output. Follow the symlinks. It returns default in case the command should fail. )rQrOrPrNÚC)ÚLC_ALLÚfilez-b)rSÚenvzlatin-1) r0rWrXr½Údictr*ÚenvironrYrZr/r[r%)Útargetr“rXrÁÚoutputrrrÚ _syscmd_fileWs   þÿ rÆ)rÚ WindowsPE)rr¡)rÚMSDOScCs|sddl}| d¡}t|dƒd}|rt|dƒ}nd}|s<|tjkrt ƒ}|rC|sht |ƒ\}}}|dkrQd}n|dkrh|dkrhd}d|dd …krfd }nd}|d vrz|sw|dkrud }nd }d}n|dd…dkr”t ƒ\}}} } d}d  | ¡}|s”|}|dkr¢|rž|dkr¢|}d}|dkr®|dkr®d}d }|||||f} t tt| ƒŽatS)an Fairly portable uname interface. Returns a tuple of strings (system, node, release, version, machine, processor) identifying the underlying platform. Note that unlike the os.uname function this also returns possible processor information as an additional tuple entry. Entries which cannot be determined are set to ''. NrrrOzMicrosoft Windowsr¡Z Microsoftz6.0rErdr rÌZ16bitér™ÚJavaú, ZOpenVMSÚ0)Ú _uname_cacher*rŠr.r0rWr¶Úanyr…rÓrcr�rJrãrHrâ) r_rär`rr‹Zinfosr€r�r–r—r˜ZvalsrrrrŠ.sZ  ü   rŠcCótƒjS)z� Returns the system/OS name, e.g. 'Linux', 'Windows' or 'Java'. An empty string is returned if the value cannot be determined. )rŠr_rrrrr_‡ór_cCr)z� Returns the computer's network name (which may not be fully qualified) An empty string is returned if the value cannot be determined. )rŠrärrrrrä�sräcCr)z� Returns the system's release, e.g. '2.2.0' or 'NT' An empty string is returned if the value cannot be determined. )rŠr`rrrrr`šrr`cCr)z‡ Returns the system's release version, e.g. '#3 on degas' An empty string is returned if the value cannot be determined. )rŠrrrrrr£rrcCr)zt Returns the machine type, e.g. 'i386' An empty string is returned if the value cannot be determined. )rŠr‹rrrrr‹¬rr‹cCr)a Returns the (true) processor name, e.g. 'amdk6' An empty string is returned if the value cannot be determined. Note that many platforms do not provide this information or simply return the same value as for machine(), e.g. NetBSD does this. )rŠrårrrrråµs råzL([\w.+]+)\s*\(#?([^,]+)(?:,\s*([\w ]*)(?:,\s*([\w :]*))?)?\)\s*\[([^\]]+)\]?z;IronPython\s*([\d\.]+)(?: \(([\d\.]+)\))? on (.NET [\d\.]+)zU([\d.]+)\s*\(IronPython\s*[\d.]+\s*\(([\d.]+)\) on ([\w.]+ [\d.]+(?: \(\d+-bit\))?)\)zE([\w.+]+)\s*\(#?([^,]+),\s*([\w ]+),\s*([\w :]+)\)\s*\[PyPy [^\]]+\]?cCsô|durtj}t |d¡}|dur|Sd|vrAd}| d¡r$t |¡}nt |¡}|dur5tdt |ƒƒ‚|  ¡\}}}d}d}nytj  d¡rmd}t  |¡}|durZtdt |ƒƒ‚|  ¡\}}}} } |durid}tj }nMd|vr�d}t  |¡}|dur„td t |ƒƒ‚|  ¡\}}}} d}n+t  |¡}|dur td t |ƒƒ‚|  ¡\}}}} }d }|dur²d}n| rº|d | }ttd ƒrÆtj\} } } nttdƒrÒtj\} } } nd} d} | d¡} t| ƒdkrë|  d¡d | ¡}||| | |||f}|t|<|S)aÛ Returns a parsed version of Python's sys.version as tuple (name, version, branch, revision, buildno, builddate, compiler) referring to the Python implementation name, version, branch, revision, build number, build date/time as string and the compiler identification string. Note that unlike the Python sys.version, the returned value for the Python version will always include the patchlevel (it defaults to '.0'). The function returns empty strings for tuple entries that cannot be determined. sys_version may be given to parse an alternative version string, e.g. if the version was read from a different Python interpreter. NZ IronPythonz*failed to parse IronPython sys.version: %srr™ZJythonz&failed to parse Jython sys.version: %sZPyPyz$failed to parse PyPy sys.version: %sz'failed to parse CPython sys.version: %sZCPythonr§Ú_gitÚ _mercurialrDr!r)r0rÚ_sys_version_cacherÚ startswithÚ_ironpython_sys_version_parserr^Ú _ironpython26_sys_version_parserrÚreprr:rWÚ_sys_version_parserÚ_pypy_sys_version_parserr2rrrr,rFrJ)Ú sys_versionrr’r^rZ alt_versionZcompilerZbuildnoZ builddateZ buildtimer¨ÚbranchZrevisionrLrrrÚ _sys_versionßsˆ    ÿÿ  ÿÿ ÿ ÿÿ ÿ       rcCó tƒdS)aR Returns a string identifying the Python implementation. Currently, the following implementations are identified: 'CPython' (C implementation of Python), 'IronPython' (.NET implementation of Python), 'Jython' (Java implementation of Python), 'PyPy' (Python implementation of Python). r©rrrrrÚpython_implementationGó rcCr)zÈ Returns the Python version as string 'major.minor.patchlevel' Note that unlike the Python sys.version, the returned value will always include the patchlevel (it defaults to 0). rrrrrrÚpython_versionTs rcCsttƒd d¡ƒS)zÝ Returns the Python version as tuple (major, minor, patchlevel) of strings. Note that unlike the Python sys.version, the returned value will always include the patchlevel (it defaults to 0). rrD)r-rrrrrrÚpython_version_tuple^s rcCr)zá Returns a string identifying the Python implementation branch. For CPython this is the SCM branch from which the Python binary was built. If not available, an empty string is returned. r!rrrrrÚ python_branchis rcCr)zå Returns a string identifying the Python implementation revision. For CPython this is the SCM revision from which the Python binary was built. If not available, an empty string is returned. rErrrrrÚpython_revisionwrrcCstƒdd…S)zh Returns a tuple (buildno, builddate) stating the Python build number and date as strings. rýrjrrrrrÚ python_build„srcCr)zS Returns a string identifying the compiler used for compiling Python. rjrrrrrÚpython_compilerŒs rcCsXt ||fd¡}|dur|Stƒ\}}}}}}||krd}|r(t|||ƒ\}}}|dkr7tƒd} | r7d}| }|dkrSt|ƒ\} } } } |rKt||ƒ}nYt|||| ƒ}nQ|dvrhtƒ\}}t||||d||ƒ}n<|d krŒtƒ\}}}\}}}|sz|s�t|||ƒ}n#t|||d |||ƒ}n|r”t||ƒ}nt t j ƒ\}}t||||||ƒ}|t||f<|S) aË Returns a single string identifying the underlying platform with as much useful information as possible (but no more :). The output is intended to be human readable rather than machine parseable. It may look different on different platforms and this is intended. If "aliased" is true, the function will use aliases for various platforms that report system names which differ from their common names, e.g. SunOS will be reported as Solaris. The system_alias() function is used to implement this. Setting terse to true causes the function to return only the absolute minimum information needed to identify the platform. NrZDarwinrZmacOSr¡)ÚLinuxÚwithrþZon) Ú_platform_cacherrŠr¢r�r…r´rCr�rÒr0r1)ÚaliasedÚterserr_rär`rr‹råZ macos_releaseZrelZversr€r�rWZlibcnameZ libcversionÚrrr—ršr›rœrÏrÐrrrrW˜sP    þþ ÿ rWzA^(?P[a-zA-Z0-9_]+)=(?P["']?)(?P.*)(?P=quote)$z\\([\\\$\"\'`]))z/etc/os-releasez/usr/lib/os-releasecCsHddddœ}|D]}t |¡}|dur!t d| d¡¡|| d¡<q|S)NrZlinux)ÚNAMEZIDZ PRETTY_NAMEz\1r”r’)Ú_os_release_liner^Ú_os_release_unescapeÚsubÚgroup)ÚlinesrbÚlineZmorrrÚ_parse_os_releaseñsý  ÿ€r(c CsžtdurKd}tD]7}z t|dd�� }t|ƒaWdƒn1s wYWt ¡Sty?}z |j}WYd}~qd}~wwt|dd t¡›�ƒ‚t ¡S)zKReturn operation system identification from freedesktop.org os-release Nzutf-8)ÚencodingzUnable to read files rÿ)Ú_os_release_cacheÚ_os_release_candidatesr4r(r/ÚerrnorJÚcopy)r,Ú candidater?ÚerrrÚfreedesktop_os_releases$ ÿ ø€ÿþr0Ú__main__rz--terseZ nonaliasedz --nonaliased)Nrrr)r)rrrrN)rrrr)rr†r)rrr†r†r¤)rr)MrùZ __copyright__Ú __version__Ú collectionsr*Úrer0rXrúrèrÚcompilerrÚASCIIr6rCrMr]rcr}rrpror…rŽr�r•r�r¢r´r¶r½rÆrÎr1rÒrÓrÔrâÚ namedtuplerãrrŠr_rär`rr‹rår r r r rrrrrrrrrrrWr"r#r+r*r(r0rÝÚargvrrÚprintÚexitrrrrÚsðY ø ü  G   þ2ñù  3  #*  $ýL  þÿ,Y     ûüÿÿ h     Oÿ  û