Add reVerSplit to cl_utils and convert func.

develop
Mike Hiretsky 13 years ago
parent 1ad2a516b2
commit 658ec65dcd

@ -807,3 +807,21 @@ def getProgPath(progname):
return progname
else:
return False
reVerSplit = re.compile(r"^(.*?)-(([^-]+?)(?:-(r\d+))?)(?:.(tbz2))?$",re.S)
def reVerSplitToPV(x):
"""Convert match from reVerSplit to PV hash"""
if x:
match = x.groups()
return {'PN':match[0],
'PF':"%s-%s"%(match[0],match[1]),
'P':"%s-%s"%(match[0],match[2]),
'PV':match[2],
'PR':match[3] or "r0",
'PVR':match[1]}
return {'PN':"",
'PF':"",
'P':"",
'PV':"",
'PR':"",
'PVR':""}.copy()

Loading…
Cancel
Save