コード例 #1
0
ファイル: nlapi.py プロジェクト: fengggli/pegasus
def getGuid(create=True, env=GID_ENV):
    """Return a GUID.
    If 'create' is True (the default), and if none is found 
    in the environment then create one.
    """
    gid = os.environ.get(env, None)
    if gid is None:
        if create:
            gid = uuid1()
    return gid
コード例 #2
0
ファイル: nlapi.py プロジェクト: AlexGourzelas/pegasus
def getGuid(create=True, env=GID_ENV):
    """Return a GUID.
    If 'create' is True (the default), and if none is found 
    in the environment then create one.
    """
    gid = os.environ.get(env, None)
    if gid is None:
        if create:
            gid = uuid1()
    return gid