B 5CìX¡wã @s$dZdZdZddlZddlZddlZddlZddlZddlZy ej Z Wn(e k rnej dkrfdZ ndZ YnXdZ d d d d d d d d dddœ Ze d¡Zdd„Ze dej¡Zejdddfdd„Zdd„Ze dej¡Ze dej¡Ze dej¡ZdZdd„Zddded fd!d"„Zd#d$„Zdddefd%d&„ZdŠd)d*„Zd‹d+d,„Z e d-¡Z!dŒd/d0„Z"d1d2d3d4d5d6d7d8d9d:d;d<œ Z#d3d=d>d?d@dAdBœZ$ddCdD„Z%dEdF„Z&dŽdHdI„Z'dJdK„Z(ddLdM„Z)dNdO„Z*dPdQ„Z+ddRdS„Z,dTdU„Z-d‘dVdW„Z.d’dXdY„Z/dZd[d\d.œZ0ejddfd]d^„Z1e 2d_d`¡Z3da4dadb„Z5dcdd„Z6dedf„Z7dgdh„Z8didj„Z9dkdl„Z:dmdn„Z;e doej¡Ze dr¡Z?iZ@d“dsdt„ZAdudv„ZBdwdx„ZCdydz„ZDd{d|„ZEd}d~„ZFdd€„ZGdd‚„ZHiZId”dƒd„„Z eJd…kr d†ejKkpðd‡ejKkZLdˆejKkod‰ejKkZMeNe eMeLƒƒe Od¡dS)•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)ÚdosÚwin32Úwin16ZNULz /dev/nullz/etcé ééé(é2éÈ) ZdevZalphaÚaZbetaÚbÚcZRCÚrcÚplÚpz([0-9]+|[._+-])c Csfg}x\t |¡D]N}|dkryt|dƒ}d}Wn tk rNt |d¡}YnX| ||f¡qW|S)Nz._+-rédr)Ú _component_reÚsplitÚintÚ ValueErrorÚ _ver_stagesÚgetÚextend)ÚversionÚresultÚvÚt©rú-/opt/alt/python37/lib64/python3.7/platform.pyÚ_comparable_versionœs rsC(__libc_init)|(GLIBC_([0-9.]+))|(libc(_\w+)?\.so(?:\.(\d[0-9.]*))?)Úi@c CsŽt}ttjdƒrtj |¡}t|dƒX}| |¡}d}x@|t|ƒkrzd|ksZd|krht  ||¡}nd}|r€|  ¡t|ƒkr¸| |¡} | r²|t |t|ƒdƒd…| }d}q<|s¸Pdd „|  ¡Dƒ\} } } } }}| rä|säd }nŒ| r|d krüd }| }n|| ƒ||ƒkrp| }n\| rp|d krpd }|rJ|rF||ƒ||ƒkrJ|}|rp|t|ƒ d…|krp||}|  ¡}qÖszlibc_ver..ZlibcÚglibc) rÚhasattrÚosÚpathr!ÚopenÚreadÚlenÚ _libc_searchÚsearchÚendÚmaxÚgroups)Ú executableÚlibrZ chunksizeÚVÚfZbinaryÚposÚmÚchunkZlibcinitr(Z glibcversionZsoZthreadsZ soversionrrrÚlibc_ver°sJ     r;c Csptj d¡rˆd}tdƒ`}xX|D]P}| ¡}t|ƒdkr |\}}nq |dkrV| ¡}q |dkr | d¡}|d}q WWdQRX|||fStj d¡rætdƒD}x<|D]4}| d¡} t| ƒdkr¤| d d kr¤d | d |fSq¤WWdQRXtj d ¡rft d ¡} x:t t| ƒd d d ƒD]"} | | dd…dkr| | =qW| rf|   ¡d}| d dd…}|||fS|||fS)zÙ Tries some special tricks to get the distribution information in case the default method fails. Currently supports older SuSE Linux, Caldera OpenLinux and Slackware Linux distributions. z/var/adm/inst-log/infoÚSuSEéZMIN_DIST_VERSIONZ DIST_IDENTú-Nz/etc/.installedrZ OpenLinuxéz/usr/lib/setupéÿÿÿÿézslack-version-Ú slackware) r*r+Úexistsr,rr.ÚstripÚisdirÚlistdirÚrangeÚsort) ÚdistnamerÚidr7ÚlineZtvÚtagÚvalueÚvaluesZpkgZverfilesÚnrrrÚ_dist_try_harderês>               rPz(\w+)[-_](release|version)z'(.+) release ([\d.]+)[^(]*(?:\((.+)\))?z1([^0-9]+)(?: release )?([\d.]+)[^(]*(?:\((.+)\))?)r<ZdebianZfedoraZredhatZcentosZmandrakeZmandrivaZrocksrBZ yellowdogZgentooZ UnitedLinuxZ turbolinuxZarchZmageiacCszd}d}t |¡}|dk r&t| ¡ƒSt |¡}|dk rDt| ¡ƒS| ¡ ¡}|rp|d}t|ƒdkrp|d}d||fS)Nr rr?)Ú_lsb_release_versionÚmatchÚtupler3Ú_release_versionrDrr.)Ú firstlinerrJr9ÚlrrrÚ_parse_release_file0s      rWr?cCs(ddl}|jdtddt|||||ƒS)NrzFdist() and linux_distribution() functions are deprecated in Python 3.5r=)Ú stacklevel)ÚwarningsÚwarnÚDeprecationWarningÚ_linux_distribution)rIrrJÚsupported_distsÚfull_distribution_namerYrrrÚlinux_distributionKs   r_c CsÚyt t¡}Wntk r(|||fSX| ¡xD|D]0}t |¡}|dk r8| ¡\}} ||kr8|}Pq8Wt|||ƒSt tj   t|¡dddd} |   ¡} WdQRXt | ƒ\}} } |rÀ|rÀ|}| rÈ| }| rÐ| }|||fS)aæ Tries to determine the name of the Linux OS distribution name. The function first looks for a distribution release file in /etc and then reverts to _dist_try_harder() in case no suitable files are found. supported_dists may be given to define the set of Linux distributions to look for. It defaults to a list of currently supported Linux distributions identified by their release file name. If full_distribution_name is true (default), the full distribution read from the OS is returned. Otherwise the short name taken from supported_dists is used. Returns a tuple (distname, version, id) which default to the args given as parameters. NÚrzutf-8Úsurrogateescape)ÚencodingÚerrors)r*rFÚ _UNIXCONFDIRÚOSErrorrHÚ_release_filenamerRr3rPr,r+ÚjoinÚreadlinerW)rIrrJr]r^ZetcÚfiler9Z _distnameZdummyr7rUZ_versionZ_idrrrr\Us0      r\cCs*ddl}|jdtddt||||ddS)aS Tries to determine the name of the Linux OS distribution name. The function first looks for a distribution release file in /etc and then reverts to _dist_try_harder() in case no suitable files are found. Returns a tuple (distname, version, id) which default to the args given as parameters. rNzFdist() and linux_distribution() functions are deprecated in Python 3.5r=)rX)r]r^)rYrZr[r\)rIrrJr]rYrrrÚdist‹s  rjr`r@cCs&ddl}|jdtddt |||¡S)z! Portable popen() interface. rNzuse os.popen insteadr=)rX)rYrZr[r*Úpopen)ÚcmdÚmodeÚbufsizerYrrrrk srkcCsd| d¡}|r| |¡ytt|ƒ}Wntk r>|}YnXttt|ƒƒ}d |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ÚmaprrÚlistÚstrrg)rÚbuildrVZintsZstringsrrrÚ _norm_version©s   rvz'(?:([\w ]+) ([\w.]+) .*\[.* ([\d.]+)\])©rrrc Csätj|kr|||fSxddD]R}y&t |¡}| ¡}| ¡rBtdƒ‚Wn$tk rh}zwWdd}~XYqXPqW|||fS| ¡}t  |¡}|dk rÚ|  ¡\}}}|ddkrº|dd…}|ddkrÒ|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. )Zverzcommand /c verz cmd /c verzcommand failedNr@ro) ÚsysÚplatformr*rkr-ÚclosererDÚ _ver_outputrRr3rv) ÚsystemÚreleaserZsupported_platformsrlÚpipeÚinfoZwhyr9rrrÚ _syscmd_verÇs,           r€Z2000ZXPZ 2003ServerZpost2003ÚVistaÚ7Ú8z8.1zpost8.1Z10Zpost10) )ér)r„r?)r„r=)r„N)ér)r…r?)r…r=)r…rp)r…N)rr)rNZ 2008ServerZ 2008ServerR2Z 2012ServerZ 2012ServerR2Zpost2012ServerR2))r„r=)r…r)r…r?)r…r=)r…rp)r…Nc Cs¨yddlm}Wntk r,||||fSX|ƒ}|jpD|dd…\}}}d |||¡}t ||f¡pxt |df¡px|}|dd…||fkrÔyd |j¡}Wn4tk rÒ|dd…dkrÎd |dd…}YnXt |d dƒdkr t  ||f¡pt  |df¡p|}y0y ddl } Wntk r6ddl } YnXWntk rPYnLXy2d } |   | j| ¡} |  | d ¡d}WdQRXWntk ršYnX||||fS) Nr)Úgetwindowsversionrpz {0}.{1}.{2}r=zSP{}é z Service Pack ZSPZ product_typez,SOFTWARE\Microsoft\Windows NT\CurrentVersionZ CurrentType)rxr†Ú ImportErrorZplatform_versionÚformatÚ_WIN32_CLIENT_RELEASESrZservice_pack_majorÚAttributeErrorÚgetattrÚ_WIN32_SERVER_RELEASESÚwinregÚ_winregZ OpenKeyExÚHKEY_LOCAL_MACHINEZ QueryValueExre) r}rÚcsdÚptyper†ZwinverZmajÚminrurŽZcvkeyÚkeyrrrÚ win32_versD r•c Cs‚d}tj |¡sdSy ddl}Wntk r4dSXt|dƒ}| |¡}WdQRX|d}d}t ¡j}|dkrxd}|||fS)Nz0/System/Library/CoreServices/SystemVersion.plistrr"ZProductVersion)r r r )ZppczPower MacintoshZPowerPC) r*r+rCÚplistlibrˆr,ÚloadÚunameÚmachine)Úfnr–r7rr}Ú versioninfor™rrrÚ _mac_ver_xmlEs    rœ©r r r cCstƒ}|dk r|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™rrrrÚmac_ver[s ržcCs@ddlm}y| |¡}|dkr$|S|Stk r:|SXdS)Nr)ÚSystem)Ú java.langrŸZ getPropertyr‹)ÚnameÚdefaultrŸrMrrrÚ _java_getpropns  r£c Cs®y ddl}Wntk r(||||fSXtd|ƒ}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 rˆr£) r}ÚvendorÚvminfoÚosinfoÚjavaZvm_nameZ vm_releaseZ vm_vendorÚos_nameÚ os_versionÚos_archrrrÚjava_verys"              r«cCsÌ|dkrd|||fS|dkr–|dkr0|||fS| d¡}|r‚yt|dƒ}Wntk rbYn X|d}t|ƒ|d<d |¡}|dkrd }qÂd }n,|d kr¶d }|r°|d }qÂd }n |dkrÂd}|||fS)zã Returns (system, release, version) aliased to common marketing names used for some systems. It also does some reordering of the information in some cases where it would otherwise cause confusion. ZRhapsodyzMacOS X ServerZSunOSÚ5rorrpÚ6ZSolarisZIRIX64ZIRIXz (64bit)Ú64bit)rrÚWindows)rrrrtrg)r|r}rrVÚmajorrrrÚ system_aliasœs2      r±cGsÈd dd„tt|ƒDƒ¡}| dd¡}| dd¡}| dd¡}| dd¡}| d d¡}| d d¡}| d d¡}| d d¡}| d d¡}x| dd¡}||kržP|}qˆWx|ddkrÂ|dd…}q¨W|S)zq Helper to format the platform string in a filename compatible format e.g. "system-version-machine". r>css|]}| ¡VqdS)N)rD)r%Úxrrrú Øsz_platform..ú Ú_ú/ú\ú:ú;ú"ú(ú)Úunknownr z--r@N)rgÚfilterr.Úreplace)ÚargsryZcleanedrrrÚ _platformÒs$          rÁcCsDy ddl}Wntk r |SXy| ¡Stk r>|SXdS)z8 Helper to determine the node name of this machine. rN)ÚsocketrˆZ gethostnamere)r¢rÂrrrÚ_nodeòs rÃcCsFtj |¡}x4tj |¡r@tj tj tj |¡t |¡¡¡}qW|S)zT In case filepath is a symlink, follow it until a real file is reached. )r*r+ÚabspathÚislinkÚnormpathrgÚdirnameÚreadlink)ÚfilepathrrrÚ_follow_symlinkss  "rÊc Csftjdkr|Syt d|tf¡}Wnttfk r<|SX| ¡ ¡}|  ¡}|rZ|r^|S|SdS)z. Interface to the system's uname command. )rrrzuname %s 2> %sN) rxryr*rkÚDEV_NULLr‹rer-rDrz)Zoptionr¢r7ÚoutputrrrrÚ _syscmd_uname s  rÍc Csztjdkr|St|ƒ}ytjd|gtjtjd}Wnttfk rJ|SX|  ¡d  d¡}|  ¡}|rn|rr|S|SdS)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. )rrrri)ÚstdoutÚstderrrzlatin-1N) rxryrÊÚ subprocessÚPopenÚPIPEZSTDOUTr‹reZ communicater$Úwait)Útargetr¢ÚprocrÌrrrrÚ _syscmd_files  rÖ)r Ú WindowsPE)r r¯)r ÚMSDOScCs*|sLddl}y| d¡}Wn |jk r:| d¡}YnXt|dƒd}|r\t|dƒ}nd}|sž|tjkržtjtkr–ttj\}}|rŽ|}|r–|}||fSd|kr®||fSd |kr¼d }nd |krÊd }n d |krÖd}d|kräd}n>d|krd|krüd}nd}n d|krd}nd|kr"d}n||fS)a” Queries the given executable (defaults to the Python interpreter binary) for various architecture information. Returns a tuple (bits, linkage) which contains information about the bit architecture and the linkage format used for the executable. Both values are returned as strings. Values that cannot be determined are returned as given by the parameter presets. If bits is given as '', the sizeof(pointer) (or sizeof(long) on Python version < 1.5.2) is used as indicator for the supported pointer size. The function relies on the system's "file" command to do the actual work. This is available on most if not all Unix platforms. On some non-Unix platforms where the "file" command does not exist and the executable is set to the Python interpreter binary defaults from _default_architecture are used. rNÚPrVéÚbitr r4z32-bitÚ32bitZN32Zn32bitz64-bitr®ZELFZPEr¯r×ZCOFFzMS-DOSrØ) ÚstructZcalcsizeÚerrorrtrÖrxr4ryÚ_default_architecture)r4ÚbitsÚlinkagerÝÚsizeZfileoutr rVrrrÚ architectureBsL      rãÚ uname_resultz-system node release version machine processorcCsœd}tdk rtSd}yt ¡\}}}}}Wntk rBd}YnX|sbttd|||||fƒƒsœ|r~tj}d}d}tƒ}d}d}|dkrât ƒ\}}}} |r¤|r¤d}|sÐdtj krÂtj   dd¡}ntj   dd¡}|sâtj   d|¡}|r:t |ƒ\}}}|d krd }n4|d kr:|d kr:d }d |dd …kr6d}nd}|dkrd|s^|dkrZd}nd}d }n8|dd…dkrœt ƒ\}} } } d}d | ¡}|sœ| }|dkr|r¶|dkr¾|}d}y ddl} Wntk ràYn&X|  dd¡\}}|dkrd}nd}|stddƒ}|dkr$d}|dkr2d}|dkr@d}|dkrNd}|dkr\d}|dkrjd}|d kr†|d kr†d }d}t||||||ƒ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 ''. rNr r?rZPROCESSOR_ARCHITEW6432ZPROCESSOR_ARCHITECTUREZPROCESSOR_IDENTIFIERzMicrosoft Windowsr¯Z Microsoftz6.0rpr)rrrÜZ16bitér§ÚJavaz, ZOpenVMSÚ0zSYI$_CPUé€ZAlphaZVAXz-pr½)Ú _uname_cacher*r˜r‹rsr¾rxryrÃr•Úenvironrr€r«rgÚvms_librˆZgetsyirÍrä)Z no_os_unameÚ processorr|Únoder}rr™Zuse_syscmd_verr‘r’r¤r¥r¦rëZcsidZ cpu_numberrrrr˜›sž                  r˜cCstƒ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|%sr|cCstƒjS)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ícCstƒjS)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}8sr}cCstƒjS)z‡ Returns the system's release version, e.g. '#3 on degas' An empty string is returned if the value cannot be determined. )r˜rrrrrrAsrcCstƒjS)zt Returns the machine type, e.g. 'i386' An empty string is returned if the value cannot be determined. )r˜r™rrrrr™Jsr™cCstƒjS)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ìSs 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|dkrtj}t |d¡}|dk r&|Sd|kr‚d}| d¡rHt |¡}n t |¡}|dkrjtdt |ƒƒ‚|  ¡\}}}d}d}nütj  d¡rÚd}t  |¡}|dkr´tdt |ƒƒ‚|  ¡\}}}} } |dkrÒd}tj }n¤d|kr"d}t  |¡}|dkr td t |ƒƒ‚|  ¡\}}}} d}n\t  |¡}|dkrFtd t |ƒƒ‚|  ¡\}}}} }d }|dkrld}n| r~|d | }ttd ƒr˜tj\} } } n"ttdƒ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: %sr r§ZJythonz&failed to parse Jython sys.version: %sZPyPyz$failed to parse PyPy sys.version: %sz'failed to parse CPython sys.version: %sZCPythonr´Ú_gitÚ _mercurialror=rç)rxrÚ_sys_version_cacherÚ startswithÚ_ironpython_sys_version_parserrRÚ _ironpython26_sys_version_parserrÚreprr3ryÚ_sys_version_parserÚ_pypy_sys_version_parserr)rîrïrr.rqrg)Ú sys_versionrr¡rRrZ alt_versionZcompilerZbuildnoZ builddateZ buildtimerµÚbranchZrevisionrVrrrÚ _sys_version}sx                      rùcCs 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)rùrrrrÚpython_implementationås rúcCs tƒdS)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). r?)rùrrrrÚpython_versionòsrûcCsttƒ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). r?ro)rSrùrrrrrÚpython_version_tupleüs rücCs tƒdS)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=)rùrrrrÚ python_branchs rýcCs tƒdS)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. rp)rùrrrrÚpython_revisions rþcCstƒdd…S)zh Returns a tuple (buildno, builddate) stating the Python build number and date as strings. rår…)rùrrrrÚ python_build"srÿcCs tƒdS)zS Returns a string identifying the compiler used for compiling Python. r…)rùrrrrÚpython_compiler*src CsÄt ||fd¡}|dk r|Stƒ\}}}}}}||kr:d}|rPt|||ƒ\}}}|dkrŠt|ƒ\} } } } |rxt||ƒ} nt|||| ƒ} n*|dkr t ¡"t ddt ¡t dƒ\}}}WdQRX|rä|sät||||d|||ƒ} n$t t j ƒ\}}t||||d||ƒ} nª|dkrXtƒ\}}}\}}}|s4|sBt|||ƒ} nt|||d |||ƒ} n\|d kr‚|rtt||ƒ} n t|||ƒ} n2|r”t||ƒ} n tt 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. Nr r¯)ZLinuxÚignorez?dist\(\) and linux_distribution\(\) functions are deprecated .*ÚwithræZonZMacOS)Ú_platform_cacherr˜r±r•rÁrYÚcatch_warningsÚfilterwarningsr[rjr;rxr4r«rã)ÚaliasedÚterserr|rír}rr™rìZrelZversr‘r’ryrIZ distversionZdistidZlibcnameZ libcversionr`rr¥r¨r©rªràrárrrry6s\               ryÚ__main__rz--terseZ nonaliasedz --nonaliased)r`r@)r )r r r rw)r r r r )r rr )r r rr)r )r )r )N)rr)PÚ__doc__Z __copyright__Ú __version__Ú collectionsrxr*ÚrerÐrYÚdevnullrËr‹ryrdrÚcompilerrÚASCIIr/r4r;rPrfrQrTZ_supported_distsrWr_r\rjrkrvr{r€rŠrr•rœržr£r«r±rÁrÃrÊrÍrÖrßrãÚ namedtuplerärér˜r|rír}rr™rìrõròrórörðrùrúrûrürýrþrÿrrÚ__name__ÚargvrrÚprintÚexitrrrrÚ sÞe      :2 6    0 0  #6   T       h      [