Example #1
0
 def get_users_data(self):
     """Get the logged users data"""
     formato = '%Y-%m-%d %H:%M'
     _who = check_output("who").split('\n')
     return [user(_who[i].split()[0], _to_seconds(time.strptime(_who[i].split()[2] +
             ' ' + _who[i].split()[3], formato)), 0, 0) for i in
             range(0, len(_who) - 1)]
Example #2
0
 def get_users_data(self):
     """Get the logged users data"""
     users = psutil.get_users()
     now = timegm(gmtime())
     return [user(u.name, now - u.started, 0, 0) for u in users]