示例#1
0
def get_system_users():
    retlist = []
    rawlist = _psutil_bsd.get_system_users()
    for item in rawlist:
        user, tty, hostname, tstamp = item
        if tty == '~':
            continue  # reboot or shutdown
        nt = nt_user(user, tty or None, hostname, tstamp)
        retlist.append(nt)
    return retlist
示例#2
0
def get_system_users():
    retlist = []
    rawlist = _psutil_bsd.get_system_users()
    for item in rawlist:
        user, tty, hostname, tstamp = item
        if tty == '~':
            continue  # reboot or shutdown
        nt = nt_user(user, tty or None, hostname, tstamp)
        retlist.append(nt)
    return retlist
示例#3
0
文件: _psbsd.py 项目: tamentis/psutil
def get_system_users():
    retlist = []
    rawlist = _psutil_bsd.get_system_users()
    for item in rawlist:
        user, tty, hostname, tstamp = item
        if tty == '~':
            continue  # reboot or shutdown
        abstty = os.path.join("/dev", tty)
        if os.path.exists(abstty):
            tty = abstty
        nt = ntuple_user(user, tty, hostname, tstamp)
        retlist.append(nt)
    return retlist
示例#4
0
def get_system_users():
    retlist = []
    rawlist = _psutil_bsd.get_system_users()
    for item in rawlist:
        user, tty, hostname, tstamp = item
        if tty == '~':
            continue  # reboot or shutdown
        abstty = os.path.join("/dev", tty)
        if os.path.exists(abstty):
            tty = abstty
        nt = ntuple_user(user, tty, hostname, tstamp)
        retlist.append(nt)
    return retlist