Advertisement
Guest User

Untitled

a guest
Nov 25th, 2015
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. def increase_pr(increment):
  2. pr = d.getVar('PR', True)
  3. pr_prefix = re.search("\D+",pr)
  4. prval = re.search("\d+",pr)
  5. if pr_prefix is None or prval is None:
  6. bb.error("Unable to analyse format of PR variable: %s" % pr)
  7. nval = int(prval.group(0)) + int(increment)
  8. pr = pr_prefix.group(0) + str(nval) + pr[prval.end():]
  9. return pr
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement