def get_system_users(): retlist = [] rawlist = _psutil_osx.get_system_users() for item in rawlist: user, tty, hostname, tstamp = item if tty == '~': continue # reboot or shutdown if not tstamp: continue nt = nt_user(user, tty or None, hostname or None, tstamp) retlist.append(nt) return retlist
def get_system_users(): retlist = [] rawlist = _psutil_osx.get_system_users() for item in rawlist: user, tty, hostname, tstamp = item if tty == '~': continue # reboot or shutdown if not tstamp: continue if tty: abstty = os.path.join("/dev", tty) if os.path.exists(abstty): tty = abstty nt = ntuple_user(user, tty, hostname or None, tstamp) retlist.append(nt) return retlist