aboutsummaryrefslogblamecommitdiffstats
path: root/libbe/names.py
blob: a0c579b63ab697e2bd4aa2ba1ed9fe2f9f550ed9 (plain) (tree)





















                                          
import commands
import os

def uuid():
    return commands.getoutput('uuidgen')

def creator():
    return os.environ["LOGNAME"]

def friendly_name(bugs, ctor):
    last = 0
    for bug in bugs:
        name = bug.name
        if name is None:
            continue
        if name.startswith(ctor):
            num = int(name.split("-")[-1])
            if num > last:
                last = num
    return "%s-%i" % (ctor, num+1)