def string_to_prco_tuple(prcoString): """returns a prco tuple (name, flags, (e, v, r)) for a string""" if type(prcoString) == types.TupleType: (n, f, v) = prcoString else: n = prcoString f = v = None # We love GPG keys as packages, esp. awesome provides like: # gpg(Fedora (13) <*****@*****.**>) if n[0] != '/' and not n.startswith("gpg("): # not a file dep - look at it for being versioned prco_split = n.split() if len(prco_split) == 3: n, f, v = prco_split # now we have 'n, f, v' where f and v could be None and None if f is not None and f not in constants.LETTERFLAGS: if f not in constants.SYMBOLFLAGS: try: f = flagToString(int(f)) except (ValueError,TypeError), e: raise Errors.MiscError, 'Invalid version flag: %s' % f else: f = constants.SYMBOLFLAGS[f]
def string_to_prco_tuple(prcoString): """returns a prco tuple (name, flags, (e, v, r)) for a string""" if type(prcoString) == types.TupleType: (n, f, v) = prcoString else: n = prcoString f = v = None # We love GPG keys as packages, esp. awesome provides like: # gpg(Fedora (13) <*****@*****.**>) if n[0] != '/' and not n.startswith("gpg("): # not a file dep - look at it for being versioned prco_split = n.split() if len(prco_split) == 3: n, f, v = prco_split # now we have 'n, f, v' where f and v could be None and None if f is not None and f not in constants.LETTERFLAGS: if f not in constants.SYMBOLFLAGS: try: f = flagToString(int(f)) except (ValueError, TypeError), e: raise Errors.MiscError, 'Invalid version flag: %s' % f else: f = constants.SYMBOLFLAGS[f]