Browse Source

OMG BROKEN LOL

import/heads/master
Cian Brennan 11 years ago
parent
commit
fe2717d3ba
1 changed files with 14 additions and 22 deletions
  1. +14
    -22
      rbusers.py

+ 14
- 22
rbusers.py View File

@@ -36,8 +36,15 @@ else :
#need a dict of users + times logged in
for user in users :
n = user.ut_user
logged_users[n] = logged_users.get(n, 0) + 1

try :
logged_users[n][0] = logged_users[n][0] + 1
except KeyError :
try:
logged_users[n][0] = 1
logged_users[n][1] = groups.get( group, default_colour )
except KeyError:
pass
#need to deal with .friends
try :
friends_file = open( os.path.expanduser('~/.friends'), 'r')
@@ -49,13 +56,6 @@ except IOError :
list_users = logged_users.keys()
list_users.sort()

#need to remove users that don't exist
for user in list_users :
try:
logged_users[user] = ( logged_users[user], pwd.getpwnam(user)[4])
except KeyError:
list_users.remove(user)

#printing stuff
print '%s%s%s' % (' ' \
, title_message, len(list_users) )
@@ -76,20 +76,12 @@ print ' ',
iter = 0
for user in list_users :
iter = iter + 1
if user in friends :
if logged_users[user] < 10 :
print format_string_norm %\
(white_text_escape, user.ljust(8), logged_users[user][0] ),
else :
print format_string_10 %\
(white_text_escape, user.ljust(8), logged_users[user][0] ),
if proc_users[user][0] < 10 :
print format_string_norm % ( logged_users[user][1],
user.ljust(8), logged_users[user][0] ),
else :
if logged_users[user] < 10 :
print format_string_norm % ( groups.get(logged_users[user][1], default_colour),
user.ljust(8), logged_users[user][0] ),
else :
print format_string_10 % (groups.get(logged_users[user][1], default_colour),
user.ljust(8), logged_users[user][0] ),
print format_string_10 % ( logged_users[user][1],
user.ljust(8), logged_users[user][0] ),
if iter >= 5 :
iter = 0
print


Loading…
Cancel
Save