Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
contego / home / tvault / .virtenv / lib / python2.7 / site-packages / oslo_utils / versionutils.pyc
Size: Mime:
ó
MEYc@sYdZddlZddlZddlmZed„Zd„Zd„Zd„Z	dS(s?
Helpers for comparing version strings.

.. versionadded:: 1.6
iÿÿÿÿN(t_cCsFtj|ƒ}tj|ƒ}|r<|d|dkr<tS||kS(spDetermine whether `requested_version` is satisfied by
    `current_version`; in other words, `current_version` is >=
    `requested_version`.

    :param requested_version: version to check for compatibility
    :param current_version: version to check against
    :param same_major: if True, the major version must be identical between
        `requested_version` and `current_version`. This is used when a
        major-version difference indicates incompatibility between the two
        versions. Since this is the common-case in practice, the default is
        True.
    :returns: True if compatible, False if not
    i(t
pkg_resourcest
parse_versiontFalse(trequested_versiontcurrent_versiont
same_majortrequested_partst
current_parts((sL/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_utils/versionutils.pyt
is_compatibles
cCsŠyJt|tjƒr$t|ƒ}nt|tƒrItjjd„|ƒSWn9tk
r…}tdƒ|}tj	t
|ƒ|ƒnXdS(s‚Convert a version to an integer.

    *version* must be a string with dots or a tuple of integers.

    .. versionadded:: 2.0
    cSs|d|S(Niè((txty((sL/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_utils/versionutils.pyt<lambda>>ssVersion %s is invalid.N(t
isinstancetsixtstring_typestconvert_version_to_tuplettupletmovestreducet	ExceptionRt
raise_fromt
ValueError(tversiontextmsg((sL/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_utils/versionutils.pytconvert_version_to_int3scCsjg}d}xE|dkrS||||}|jdtj|ƒƒ||}qWdjtt|ƒƒS(sPConvert a version integer to a string with dots.

    .. versionadded:: 2.0
    ièit.(tinsertRt	text_typetjointmaptstr(tversion_inttversion_numberstfactortversion_number((sL/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_utils/versionutils.pytconvert_version_to_strDscCstd„|jdƒDƒƒS(sNConvert a version string with dots to a tuple.

    .. versionadded:: 2.0
    css|]}t|ƒVqdS(N(tint(t.0tpart((sL/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_utils/versionutils.pys	<genexpr>XsR(Rtsplit(tversion_str((sL/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_utils/versionutils.pyRSs(
t__doc__RRtoslo_utils._i18nRtTrueR	RR%R(((sL/home/tvault/.virtenv/lib/python2.7/site-packages/oslo_utils/versionutils.pyt<module>s