(self, versionPredicateStr)
Parse a version predicate string.
Parse a version predicate string.
Parse a version predicate string .
def __init__(self, versionPredicateStr):
        """Parse a version predicate string.
        """
        # Fields:
        #    name:  package name
        #    pred:  list of (comparison string, StrictVersion)

        versionPredicateStr = versionPredicateStr.strip()
        if not versionPredicateStr:
            raise ValueError("empty package restriction")
        match = re_validPackage.match(versionPredicateStr)
        if not match:
            raise ValueError("bad package name in %r" % versionPredicateStr)
        self.name, paren = match.groups()
        paren = paren.strip()
        if paren:
            match = re_paren.match(paren)
            if not match:
                raise ValueError("expected parenthesized list: %r" % paren)
            str = match.groups()[0]
            self.pred = [splitUp(aPred) for aPred in str.split(",")]
            if not self.pred:
                raise ValueError("empty parenthesized list in %r"
                                 % versionPredicateStr)
        else:
            self.pred = []
def __init__ ( self , versionPredicateStr ) : # Fields: #    name:  package name #    pred:  list of (comparison string, StrictVersion) versionPredicateStr = versionPredicateStr . strip ( ) if not versionPredicateStr : raise ValueError ( "empty package restriction" ) match = re_validPackage . match ( versionPredicateStr ) if not match : raise ValueError ( "bad package name in %r" % versionPredicateStr ) self . name , paren = match . groups ( ) paren = paren . strip ( ) if paren : match = re_paren . match ( paren ) if not match : raise ValueError ( "expected parenthesized list: %r" % paren ) str = match . groups ( ) [ 0 ] self . pred = [ splitUp ( aPred ) for aPred in str . split ( "," ) ] if not self . pred : raise ValueError ( "empty parenthesized list in %r" % versionPredicateStr ) else : self . pred = [ ]