b374k
m1n1 1.01
Apache/2.2.15 (CentOS)
Linux obd60-6c49958d75-2q7cw 5.4.0-174-generic #193-Ubuntu SMP Thu Mar 7 14:29:28 UTC 2024 x86_64
uid=48(apache) gid=48(apache) groups=48(apache)
server ip : 172.67.192.52 | your ip : 10.244.126.0
safemode OFF
 >  / usr / lib64 / python2.6 / distutils /
Filename/usr/lib64/python2.6/distutils/versionpredicate.pyc
Size5.47 kb
Permissionrw-r--r--
Ownerapache
Create time23-Dec-2025 17:41
Last modified20-Jun-2019 19:45
Last accessed20-Jun-2019 19:45
Actionsedit | rename | delete | download (gzip)
Viewtext | code | image
Ñò
§ÚêLc@sÈdZddkZddkZddkZeid�Zeid�Zeid�Zd�Z hei
d6ei d6ei d 6ei
d
6eid 6eid 6Zd
dd��YZdad�ZdS(sBModule for parsing and testing package version predicate strings.
iÿÿÿÿNs'(?i)^\s*([a-z_]\w*(?:\.[a-z_]\w*)*)(.*)s^\s*\((.*)\)\s*$s%^\s*(<=|>=|<|>|!=|==)\s*([^\s,]+)\s*$cCsRti|�}|ptd|��n|i�\}}|tii|�fS(sVParse a single version comparison.

Return (comparison string, StrictVersion)
s"bad package restriction syntax: %r(tre_splitComparisontmatcht
ValueErrortgroupst distutilstversiont
StrictVersion(tpredtrestcomptverStr((s2/usr/lib64/python2.6/distutils/versionpredicate.pytsplitUps
t<s<=s==t>s>=s!=tVersionPredicatecBs)eZdZd�Zd�Zd�ZRS(s»Parse and test package version predicates.

>>> v = VersionPredicate('pyepat.abc (>1.0, <3333.3a1, !=1555.1b3)')

The `name` attribute provides the full dotted name that is given::

>>> v.name
'pyepat.abc'

The str() of a `VersionPredicate` provides a normalized
human-readable version of the expression::

>>> print v
pyepat.abc (> 1.0, < 3333.3a1, != 1555.1b3)

The `satisfied_by()` method can be used to determine with a given
version number is included in the set described by the version
restrictions::

>>> v.satisfied_by('1.1')
True
>>> v.satisfied_by('1.4')
True
>>> v.satisfied_by('1.0')
False
>>> v.satisfied_by('4444.4')
False
>>> v.satisfied_by('1555.1b3')
False

`VersionPredicate` is flexible in accepting extra whitespace::

>>> v = VersionPredicate(' pat( == 0.1 ) ')
>>> v.name
'pat'
>>> v.satisfied_by('0.1')
True
>>> v.satisfied_by('0.2')
False

If any version numbers passed in do not conform to the
restrictions of `StrictVersion`, a `ValueError` is raised::

>>> v = VersionPredicate('p1.p2.p3.p4(>=1.0, <=1.3a1, !=1.2zb3)')
Traceback (most recent call last):
...
ValueError: invalid version number '1.2zb3'

It the module or package name given does not conform to what's
allowed as a legal module or package name, `ValueError` is
raised::

>>> v = VersionPredicate('foo-bar')
Traceback (most recent call last):
...
ValueError: expected parenthesized list: '-bar'

>>> v = VersionPredicate('foo bar (12.21)')
Traceback (most recent call last):
...
ValueError: expected parenthesized list: 'bar (12.21)'

cCs|i�}|ptd��nti|�}|ptd|��n|i�\|_}|i�}|o�ti|�}|ptd|��n|i�d}g}|id�D]}|t|�qÃ~|_ |i ptd|��q
n
g|_ dS(s*Parse a version predicate string.
sempty package restrictionsbad package name in %rsexpected parenthesized list: %rit,sempty parenthesized list in %rN(
tstripRtre_validPackageRRtnametre_parentsplitR R(tselftversionPredicateStrRtparentstrt_[1]taPred((s2/usr/lib64/python2.6/distutils/versionpredicate.pyt__init___s$  3
cCsj|ioUg}|iD]!\}}||dt|�q~}|iddi|�dS|iSdS(Nt s (s, t)(RRRtjoin(RRtcondtvertseq((s2/usr/lib64/python2.6/distutils/versionpredicate.pyt__str__zs
8cCs7x0|iD]%\}}t|||�ptSq
WtS(sÏTrue if version is compatible with all the predicates in self.
The parameter version must be acceptable to the StrictVersion
constructor. It may be either a string or StrictVersion.
(RtcompmaptFalsetTrue(RRRR ((s2/usr/lib64/python2.6/distutils/versionpredicate.pyt satisfied_by�s

 (t__name__t
__module__t__doc__RR"R&(((s2/usr/lib64/python2.6/distutils/versionpredicate.pyRs?  cCs�tdjotid�an|i�}ti|�}|ptd|��n|id�pd}|oti i
|�}n|id�|fS(s9Return the name and optional version number of a provision.

The version number, if given, will be returned as a `StrictVersion`
instance, otherwise it will be `None`.

>>> split_provision('mypkg')
('mypkg', None)
>>> split_provision(' mypkg( 1.2 ) ')
('mypkg', StrictVersion ('1.2'))
s=([a-zA-Z_]\w*(?:\.[a-zA-Z_]\w*)*)(?:\s*\(\s*([^)\s]+)\s*\))?$s"illegal provides specification: %riiN( t
_provision_rxtNonetretcompileRRRtgroupRRR(tvaluetmR ((s2/usr/lib64/python2.6/distutils/versionpredicate.pytsplit_provision�s

 ((R)R,tdistutils.versionRtoperatorR-RRRR tlttleteqtgttgetneR#RR+R*R1(((s2/usr/lib64/python2.6/distutils/versionpredicate.pyt<module>s    !!n