3 \ @s~ddlZddlZddlZejdejZejdZejdZddZ ej ej ej ej ejejdZGdd d Zdad d ZdS) Nz'(?i)^\s*([a-z_]\w*(?:\.[a-z_]\w*)*)(.*)z^\s*\((.*)\)\s*$z%^\s*(<=|>=|<|>|!=|==)\s*([^\s,]+)\s*$cCs6tj|}|std||j\}}|tjj|fS)Nz"bad package restriction syntax: %r)re_splitComparisonmatch ValueErrorgroups distutilsversion StrictVersion)predrescompZverStrr 2/usr/lib64/python3.6/distutils/versionpredicate.pysplitUps    r)z>=z!=c@s$eZdZddZddZddZdS)VersionPredicatecCs|j}|stdtj|}|s.td||j\|_}|j}|rtj|}|sbtd||jd}dd|jdD|_|jstd|ng|_dS) Nzempty package restrictionzbad package name in %rzexpected parenthesized list: %rrcSsg|] }t|qSr )r).0ZaPredr r r tsz-VersionPredicate.__init__..,zempty parenthesized list in %r) striprre_validPackagerrnamere_parensplitr )selfZversionPredicateStrrZparenstrr r r __init__`s$      zVersionPredicate.__init__cCs8|jr.dd|jD}|jddj|dS|jSdS)NcSs g|]\}}|dt|qS) )r)rcondverr r r r}sz,VersionPredicate.__str__..z (z, ))r rjoin)rseqr r r __str__{szVersionPredicate.__str__cCs*x$|jD]\}}t|||sdSqWdS)NFT)r compmap)rrrrr r r satisfied_byszVersionPredicate.satisfied_byN)__name__ __module__ __qualname__rr#r%r r r r rsArcCsdtdkrtjdtja|j}tj|}|s8td||jdpDd}|rVtj j |}|jd|fS)Nz=([a-zA-Z_]\w*(?:\.[a-zA-Z_]\w*)*)(?:\s*\(\s*([^)\s]+)\s*\))?$z"illegal provides specification: %r) _provision_rxrecompileASCIIrrrgrouprrr)valuemrr r r split_provisions    r2)r,Zdistutils.versionroperatorr-r.rrrrltleeqgtgener$rr+r2r r r r s   n