示例#1
0
文件: grp.py 项目: babble/babble
def getgrnam(name):
    """
    getgrnam(name) -> tuple
    Return the group database entry for the given group name.  If
    name is not valid, raise KeyError.
    """
    try:
        return struct_group(_posix.getgrnam(name))
    except NullPointerException:
        raise KeyError, name
示例#2
0
def getgrnam(name):
    """
    getgrnam(name) -> tuple
    Return the group database entry for the given group name.  If
    name is not valid, raise KeyError.
    """
    entry = _posix.getgrnam(name)
    if not entry:
        raise KeyError(name)
    return struct_group(entry)
示例#3
0
def getgrnam(name):
    """
    getgrnam(name) -> tuple
    Return the group database entry for the given group name.  If
    name is not valid, raise KeyError.
    """
    try:
        return struct_group(_posix.getgrnam(name))
    except NullPointerException:
        raise KeyError, name
示例#4
0
def getgrnam(name):
    """
    getgrnam(name) -> tuple
    Return the group database entry for the given group name.  If
    name is not valid, raise KeyError.
    """
    entry = _posix.getgrnam(name)
    if not entry:
        raise KeyError(name)
    return struct_group(entry)