ó •abc@sçdZddlZddlZddlZddlZddlZddlZddlZejj dƒ rˆe dj ejƒƒ‚ndZ dZ iZidd6d d 6Zid d 6Zejd ƒZejd ƒZddde dfZed„Zd„Zed„Zeed„Zed„Zed„Zed„Zed„Zd„Zd„Z eed„Z!d„Z"d„Z#d„Z$d „Z%d!„Z&d"„Z'd#e(fd$„ƒYZ)e)ƒZ*d%„Z+e,d&krãe+ƒndS('s, The ``distro`` package (``distro`` stands for Linux Distribution) provides information about the Linux distribution it runs on, such as a reliable machine-readable distro ID, or version information. It is a renewed alternative implementation for Python's original :py:func:`platform.linux_distribution` function, but it provides much more functionality. An alternative implementation became necessary because Python 3.5 deprecated this function, and Python 3.7 is expected to remove it altogether. Its predecessor function :py:func:`platform.dist` was already deprecated since Python 2.6 and is also expected to be removed in Python 3.7. Still, there are many cases in which access to Linux distribution information is needed. See `Python issue 1322 `_ for more information. iÿÿÿÿNtlinuxsUnsupported platform: {0}s/etcs os-releasetoracletenterpriseenterprisetrheltredhatenterpriseworkstationtredhatsA(?:[^)]*\)(.*)\()? *(?:STL )?([\d.+\-a-z]*\d) *(?:esaeler *)?(.+)s(\w+)[-_](release|version)$tdebian_versions lsb-releases oem-releasessystem-releasecCs tj|ƒS(s$ Return information about the current Linux distribution as a tuple ``(id_name, version, codename)`` with items as follows: * ``id_name``: If *full_distribution_name* is false, the result of :func:`distro.id`. Otherwise, the result of :func:`distro.name`. * ``version``: The result of :func:`distro.version`. * ``codename``: The result of :func:`distro.codename`. The interface of this function is compatible with the original :py:func:`platform.linux_distribution` function, supporting a subset of its parameters. The data it returns may not exactly be the same, because it uses more data sources than the original function, and that may lead to different data if the Linux distribution is not consistent across multiple data sources it provides (there are indeed such distributions ...). Another reason for differences is the fact that the :func:`distro.id` method normalizes the distro ID string to a reliable machine-readable value for a number of popular Linux distributions. (t_distrotlinux_distribution(tfull_distribution_name((s6/usr/lib/python2.7/site-packages/pip/_vendor/distro.pyR`scCs tjƒS(sÝ Return the distro ID of the current Linux distribution, as a machine-readable string. For a number of Linux distributions, the returned distro ID value is *reliable*, in the sense that it is documented and that it does not change across releases of the distribution. This package maintains the following reliable distro ID values: ============== ========================================= Distro ID Distribution ============== ========================================= "ubuntu" Ubuntu "debian" Debian "rhel" RedHat Enterprise Linux "centos" CentOS "fedora" Fedora "sles" SUSE Linux Enterprise Server "opensuse" openSUSE "amazon" Amazon Linux "arch" Arch Linux "cloudlinux" CloudLinux OS "exherbo" Exherbo Linux "gentoo" GenToo Linux "ibm_powerkvm" IBM PowerKVM "kvmibm" KVM for IBM z Systems "linuxmint" Linux Mint "mageia" Mageia "mandriva" Mandriva Linux "parallels" Parallels "pidora" Pidora "raspbian" Raspbian "oracle" Oracle Linux (and Oracle Enterprise Linux) "scientific" Scientific Linux "slackware" Slackware "xenserver" XenServer ============== ========================================= If you have a need to get distros for reliable IDs added into this set, or if you find that the :func:`distro.id` function returns a different distro ID for one of the listed distros, please create an issue in the `distro issue tracker`_. **Lookup hierarchy and transformations:** First, the ID is obtained from the following sources, in the specified order. The first available and non-empty value is used: * the value of the "ID" attribute of the os-release file, * the value of the "Distributor ID" attribute returned by the lsb_release command, * the first part of the file name of the distro release file, The so determined ID value then passes the following transformations, before it is returned by this method: * it is translated to lower case, * blanks (which should not be there anyway) are translated to underscores, * a normalization of the ID is performed, based upon `normalization tables`_. The purpose of this normalization is to ensure that the ID is as reliable as possible, even across incompatible changes in the Linux distributions. A common reason for an incompatible change is the addition of an os-release file, or the addition of the lsb_release command, with ID values that differ from what was previously determined from the distro release file name. (Rtid(((s6/usr/lib/python2.7/site-packages/pip/_vendor/distro.pyR |sHcCs tj|ƒS(sn Return the name of the current Linux distribution, as a human-readable string. If *pretty* is false, the name is returned without version or codename. (e.g. "CentOS Linux") If *pretty* is true, the version and codename are appended. (e.g. "CentOS Linux 7.1.1503 (Core)") **Lookup hierarchy:** The name is obtained from the following sources, in the specified order. The first available and non-empty value is used: * If *pretty* is false: - the value of the "NAME" attribute of the os-release file, - the value of the "Distributor ID" attribute returned by the lsb_release command, - the value of the "" field of the distro release file. * If *pretty* is true: - the value of the "PRETTY_NAME" attribute of the os-release file, - the value of the "Description" attribute returned by the lsb_release command, - the value of the "" field of the distro release file, appended with the value of the pretty version ("" and "" fields) of the distro release file, if available. (Rtname(tpretty((s6/usr/lib/python2.7/site-packages/pip/_vendor/distro.pyR Çs$cCstj||ƒS(sy Return the version of the current Linux distribution, as a human-readable string. If *pretty* is false, the version is returned without codename (e.g. "7.0"). If *pretty* is true, the codename in parenthesis is appended, if the codename is non-empty (e.g. "7.0 (Maipo)"). Some distributions provide version numbers with different precisions in the different sources of distribution information. Examining the different sources in a fixed priority order does not always yield the most precise version (e.g. for Debian 8.2, or CentOS 7.1). The *best* parameter can be used to control the approach for the returned version: If *best* is false, the first non-empty version number in priority order of the examined sources is returned. If *best* is true, the most precise version number out of all examined sources is returned. **Lookup hierarchy:** In all cases, the version number is obtained from the following sources. If *best* is false, this order represents the priority order: * the value of the "VERSION_ID" attribute of the os-release file, * the value of the "Release" attribute returned by the lsb_release command, * the version number parsed from the "" field of the first line of the distro release file, * the version number parsed from the "PRETTY_NAME" attribute of the os-release file, if it follows the format of the distro release files. * the version number parsed from the "Description" attribute returned by the lsb_release command, if it follows the format of the distro release files. (Rtversion(R tbest((s6/usr/lib/python2.7/site-packages/pip/_vendor/distro.pyR îs)cCs tj|ƒS(s£ Return the version of the current Linux distribution as a tuple ``(major, minor, build_number)`` with items as follows: * ``major``: The result of :func:`distro.major_version`. * ``minor``: The result of :func:`distro.minor_version`. * ``build_number``: The result of :func:`distro.build_number`. For a description of the *best* parameter, see the :func:`distro.version` method. (Rt version_parts(R((s6/usr/lib/python2.7/site-packages/pip/_vendor/distro.pyRscCs tj|ƒS(s8 Return the major version of the current Linux distribution, as a string, if provided. Otherwise, the empty string is returned. The major version is the first part of the dot-separated version string. For a description of the *best* parameter, see the :func:`distro.version` method. (Rt major_version(R((s6/usr/lib/python2.7/site-packages/pip/_vendor/distro.pyR+s cCs tj|ƒS(s9 Return the minor version of the current Linux distribution, as a string, if provided. Otherwise, the empty string is returned. The minor version is the second part of the dot-separated version string. For a description of the *best* parameter, see the :func:`distro.version` method. (Rt minor_version(R((s6/usr/lib/python2.7/site-packages/pip/_vendor/distro.pyR8s cCs tj|ƒS(s6 Return the build number of the current Linux distribution, as a string, if provided. Otherwise, the empty string is returned. The build number is the third part of the dot-separated version string. For a description of the *best* parameter, see the :func:`distro.version` method. (Rt build_number(R((s6/usr/lib/python2.7/site-packages/pip/_vendor/distro.pyREs cCs tjƒS(s Return a space-separated list of distro IDs of distributions that are closely related to the current Linux distribution in regards to packaging and programming interfaces, for example distributions the current distribution is a derivative from. **Lookup hierarchy:** This information item is only provided by the os-release file. For details, see the description of the "ID_LIKE" attribute in the `os-release man page `_. (Rtlike(((s6/usr/lib/python2.7/site-packages/pip/_vendor/distro.pyRRscCs tjƒS(s© Return the codename for the release of the current Linux distribution, as a string. If the distribution does not have a codename, an empty string is returned. Note that the returned codename is not always really a codename. For example, openSUSE returns "x86_64". This function does not handle such cases in any special way and just returns the string it finds, if any. **Lookup hierarchy:** * the codename within the "VERSION" attribute of the os-release file, if provided, * the value of the "Codename" attribute returned by the lsb_release command, * the value of the "" field of the distro release file. (Rtcodename(((s6/usr/lib/python2.7/site-packages/pip/_vendor/distro.pyRcscCstj||ƒS(s× Return certain machine-readable information items about the current Linux distribution in a dictionary, as shown in the following example: .. sourcecode:: python { 'id': 'rhel', 'version': '7.0', 'version_parts': { 'major': '7', 'minor': '0', 'build_number': '' }, 'like': 'fedora', 'codename': 'Maipo' } The dictionary structure and keys are always the same, regardless of which information items are available in the underlying data sources. The values for the various keys are as follows: * ``id``: The result of :func:`distro.id`. * ``version``: The result of :func:`distro.version`. * ``version_parts -> major``: The result of :func:`distro.major_version`. * ``version_parts -> minor``: The result of :func:`distro.minor_version`. * ``version_parts -> build_number``: The result of :func:`distro.build_number`. * ``like``: The result of :func:`distro.like`. * ``codename``: The result of :func:`distro.codename`. For a description of the *pretty* and *best* parameters, see the :func:`distro.version` method. (Rtinfo(R R((s6/usr/lib/python2.7/site-packages/pip/_vendor/distro.pyR{s)cCs tjƒS(så Return a dictionary containing key-value pairs for the information items from the os-release file data source of the current Linux distribution. See `os-release file`_ for details about these information items. (Rtos_release_info(((s6/usr/lib/python2.7/site-packages/pip/_vendor/distro.pyR§scCs tjƒS(sø Return a dictionary containing key-value pairs for the information items from the lsb_release command data source of the current Linux distribution. See `lsb_release command output`_ for details about these information items. (Rtlsb_release_info(((s6/usr/lib/python2.7/site-packages/pip/_vendor/distro.pyR±scCs tjƒS(sí Return a dictionary containing key-value pairs for the information items from the distro release file data source of the current Linux distribution. See `distro release file`_ for details about these information items. (Rtdistro_release_info(((s6/usr/lib/python2.7/site-packages/pip/_vendor/distro.pyR¼scCs tj|ƒS(s– Return a single named information item from the os-release file data source of the current Linux distribution. Parameters: * ``attribute`` (string): Key of the information item. Returns: * (string): Value of the information item, if the item exists. The empty string, if the item does not exist. See `os-release file`_ for details about these information items. (Rtos_release_attr(t attribute((s6/usr/lib/python2.7/site-packages/pip/_vendor/distro.pyRÆscCs tj|ƒS(s° Return a single named information item from the lsb_release command output data source of the current Linux distribution. Parameters: * ``attribute`` (string): Key of the information item. Returns: * (string): Value of the information item, if the item exists. The empty string, if the item does not exist. See `lsb_release command output`_ for details about these information items. (Rtlsb_release_attr(R((s6/usr/lib/python2.7/site-packages/pip/_vendor/distro.pyRÙscCs tj|ƒS(sž Return a single named information item from the distro release file data source of the current Linux distribution. Parameters: * ``attribute`` (string): Key of the information item. Returns: * (string): Value of the information item, if the item exists. The empty string, if the item does not exist. See `distro release file`_ for details about these information items. (Rtdistro_release_attr(R((s6/usr/lib/python2.7/site-packages/pip/_vendor/distro.pyRístLinuxDistributioncBs1eZdZeddd„Zd„Zed„Zd„Zed„Z eed„Z ed„Z ed „Z ed „Z ed „Zd „Zd „Zeed„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zed„ƒZd„Zed„ƒZd„Zd„Zed„ƒZRS(s Provides information about a Linux distribution. This package creates a private module-global instance of this class with default initialization arguments, that is used by the `consolidated accessor functions`_ and `single source accessor functions`_. By using default initialization arguments, that module-global instance returns data about the current Linux distribution (i.e. the distro this package runs on). Normally, it is not necessary to create additional instances of this class. However, in situations where control is needed over the exact data sources that are used, instances of this class can be created with a specific distro release file, or a specific os-release file, or without invoking the lsb_release command. tcCsj|ptjjttƒ|_|p'd|_|jƒ|_|rN|j ƒni|_ |j ƒ|_ dS(s8 The initialization method of this class gathers information from the available data sources, and stores that in private instance attributes. Subsequent access to the information items uses these private instance attributes, so that the data sources are read only once. Parameters: * ``include_lsb`` (bool): Controls whether the `lsb_release command output`_ is included as a data source. If the lsb_release command is not available in the program execution path, the data source for the lsb_release command will be empty. * ``os_release_file`` (string): The path name of the `os-release file`_ that is to be used as a data source. An empty string (the default) will cause the default path name to be used (see `os-release file`_ for details). If the specified or defaulted os-release file does not exist, the data source for the os-release file will be empty. * ``distro_release_file`` (string): The path name of the `distro release file`_ that is to be used as a data source. An empty string (the default) will cause a default search algorithm to be used (see `distro release file`_ for details). If the specified distro release file does not exist, or if no default distro release file can be found, the data source for the distro release file will be empty. Public instance attributes: * ``os_release_file`` (string): The path name of the `os-release file`_ that is actually used as a data source. The empty string if no distro release file is used as a data source. * ``distro_release_file`` (string): The path name of the `distro release file`_ that is actually used as a data source. The empty string if no distro release file is used as a data source. Raises: * :py:exc:`IOError`: Some I/O issue with an os-release file or distro release file. * :py:exc:`subprocess.CalledProcessError`: The lsb_release command had some issue (other than not being available in the program execution path). * :py:exc:`UnicodeError`: A data source has unexpected characters or uses an unexpected encoding. RN( tostpathtjoint _UNIXCONFDIRt_OS_RELEASE_BASENAMEtos_release_filetdistro_release_filet_get_os_release_infot_os_release_infot_get_lsb_release_infot_lsb_release_infot_get_distro_release_infot_distro_release_info(tselft include_lsbR$R%((s6/usr/lib/python2.7/site-packages/pip/_vendor/distro.pyt__init__s ;cCs(dj|j|j|j|j|jƒS(s Return repr of all info sLinuxDistribution(os_release_file={0!r}, distro_release_file={1!r}, _os_release_info={2!r}, _lsb_release_info={3!r}, _distro_release_info={4!r})(tformatR$R%R'R)R+(R,((s6/usr/lib/python2.7/site-packages/pip/_vendor/distro.pyt__repr__Us cCs1|r|jƒn |jƒ|jƒ|jƒfS(sû Return information about the Linux distribution that is compatible with Python's :func:`platform.linux_distribution`, supporting a subset of its parameters. For details, see :func:`distro.linux_distribution`. (R R R R(R,R ((s6/usr/lib/python2.7/site-packages/pip/_vendor/distro.pyRes  cCssd„}|jdƒ}|r+||tƒS|jdƒ}|rM||tƒS|jdƒ}|ro||tƒSdS(srReturn the distro ID of the Linux distribution, as a string. For details, see :func:`distro.id`. cSs(|jƒjddƒ}|j||ƒS(Nt t_(tlowertreplacetget(t distro_idttable((s6/usr/lib/python2.7/site-packages/pip/_vendor/distro.pyt normalizexsR tdistributor_idR(RtNORMALIZED_OS_IDRtNORMALIZED_LSB_IDRtNORMALIZED_DISTRO_ID(R,R8R6((s6/usr/lib/python2.7/site-packages/pip/_vendor/distro.pyR ss    cCsŸ|jdƒp*|jdƒp*|jdƒ}|r•|jdƒpN|jdƒ}|s•|jdƒ}|jdtƒ}|r’|d|}q’q•n|pždS(sx Return the name of the Linux distribution, as a string. For details, see :func:`distro.name`. R R9t pretty_namet descriptionR R1R(RRRR tTrue(R,R R R ((s6/usr/lib/python2.7/site-packages/pip/_vendor/distro.pyR ŠscCs|jdƒ|jdƒ|jdƒ|j|jdƒƒjddƒ|j|jdƒƒjddƒg}d}|r¿xk|D]9}|jdƒ|jdƒks¯|dkr|}qqWn'x$|D]}|dkrÆ|}PqÆqÆW|r|r|jƒrdj||jƒƒ}n|S(s~ Return the version of the Linux distribution, as a string. For details, see :func:`distro.version`. t version_idtreleaseR=RR>t.u {0} ({1})(RRRt_parse_distro_release_contentR5tcountRR/(R,R RtversionsR tv((s6/usr/lib/python2.7/site-packages/pip/_vendor/distro.pyR s&   ! *  cCsq|jd|ƒ}|rmtjdƒ}|j|ƒ}|rm|jƒ\}}}||p]d|pfdfSndS(sž Return the version of the Linux distribution, as a tuple of version numbers. For details, see :func:`distro.version_parts`. Rs(\d+)\.?(\d+)?\.?(\d+)?R(RRR(R tretcompiletmatchtgroups(R,Rt version_strt version_regextmatchestmajortminorR((s6/usr/lib/python2.7/site-packages/pip/_vendor/distro.pyR¾scCs|j|ƒdS(s† Return the major version number of the current distribution. For details, see :func:`distro.major_version`. i(R(R,R((s6/usr/lib/python2.7/site-packages/pip/_vendor/distro.pyRÎscCs|j|ƒdS(s„ Return the minor version number of the Linux distribution. For details, see :func:`distro.minor_version`. i(R(R,R((s6/usr/lib/python2.7/site-packages/pip/_vendor/distro.pyRÖscCs|j|ƒdS(s{ Return the build number of the Linux distribution. For details, see :func:`distro.build_number`. i(R(R,R((s6/usr/lib/python2.7/site-packages/pip/_vendor/distro.pyRÞscCs|jdƒpdS(s† Return the IDs of distributions that are like the Linux distribution. For details, see :func:`distro.like`. tid_likeR(R(R,((s6/usr/lib/python2.7/site-packages/pip/_vendor/distro.pyRæscCs1|jdƒp0|jdƒp0|jdƒp0dS(ss Return the codename of the Linux distribution. For details, see :func:`distro.codename`. RR(RRR(R,((s6/usr/lib/python2.7/site-packages/pip/_vendor/distro.pyRîscCsstd|jƒd|j||ƒdtd|j|ƒd|j|ƒd|j|ƒƒd|jƒd|jƒƒS( s’ Return certain machine-readable information about the Linux distribution. For details, see :func:`distro.info`. R R RRNRORRR(tdictR R RRRRR(R,R R((s6/usr/lib/python2.7/site-packages/pip/_vendor/distro.pyRùs  cCs|jS(sÜ Return a dictionary containing key-value pairs for the information items from the os-release file data source of the Linux distribution. For details, see :func:`distro.os_release_info`. (R'(R,((s6/usr/lib/python2.7/site-packages/pip/_vendor/distro.pyR scCs|jS(sé Return a dictionary containing key-value pairs for the information items from the lsb_release command data source of the Linux distribution. For details, see :func:`distro.lsb_release_info`. (R)(R,((s6/usr/lib/python2.7/site-packages/pip/_vendor/distro.pyRscCs|jS(sì Return a dictionary containing key-value pairs for the information items from the distro release file data source of the Linux distribution. For details, see :func:`distro.distro_release_info`. (R+(R,((s6/usr/lib/python2.7/site-packages/pip/_vendor/distro.pyRscCs|jj|dƒS(sº Return a single named information item from the os-release file data source of the Linux distribution. For details, see :func:`distro.os_release_attr`. R(R'R5(R,R((s6/usr/lib/python2.7/site-packages/pip/_vendor/distro.pyR)scCs|jj|dƒS(sÆ Return a single named information item from the lsb_release command output data source of the Linux distribution. For details, see :func:`distro.lsb_release_attr`. R(R)R5(R,R((s6/usr/lib/python2.7/site-packages/pip/_vendor/distro.pyR2scCs|jj|dƒS(s Return a single named information item from the distro release file data source of the Linux distribution. For details, see :func:`distro.distro_release_attr`. R(R+R5(R,R((s6/usr/lib/python2.7/site-packages/pip/_vendor/distro.pyR;scCsAtjj|jƒr=t|jƒ}|j|ƒSWdQXniS(sœ Get the information items from the specified os-release file. Returns: A dictionary containing all information items. N(RR tisfileR$topent_parse_os_release_content(R,t release_file((s6/usr/lib/python2.7/site-packages/pip/_vendor/distro.pyR&DscCsNi}tj|dtƒ}t|_tjddkrat|jtƒra|jjdƒ|_nt |ƒ}xÚ|D]Ò}d|krt|j ddƒ\}}t|tƒr¿|jdƒ}n|||j ƒ<|dkrFt j d |ƒ}|r6|jƒ}|jd ƒ}|jd ƒ}|jƒ}||d sLinux distro info tools--jsons-jthelps!Output in machine readable formattactiont store_truetindentit sort_keyssName: %sR s Version: %ss Codename: %s(targparsetloggingt getLoggerRtsetLeveltDEBUGt addHandlert StreamHandlerR\RntArgumentParsert add_argumentt parse_argstjsonRtdumpsR?R R R(R—tloggertparsertargstdistribution_versiontdistribution_codename((s6/usr/lib/python2.7/site-packages/pip/_vendor/distro.pytmains(   ( t__main__(-RRRGR\R¡RZR˜Rptplatformt startswitht ImportErrorR/R"R#R:R;R<RHRŒRƒR†R?RR RR R RRRRRRRRRRRRRtobjectRRR¨R(((s6/usr/lib/python2.7/site-packages/pip/_vendor/distro.pytsd                K ',   ,   ÿÿ