~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to bin/ivle-listusers

  • Committer: chadnickbok
  • Date: 2009-01-22 01:21:48 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:1172
Fixed an issue with my previous patch to this file. Now, if
publicmode is not set, users will not be shown tracebacks.

Previously, if publicmode was undefined, users would be shown
tracebacks.

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
import os
28
28
import getopt
29
29
 
30
 
import ivle.config
31
 
import ivle.database
 
30
import ivle.db
32
31
 
33
32
# Options processing
34
33
def usage():
57
56
    print "Must run listusers.py as root."
58
57
    sys.exit()
59
58
 
60
 
store = ivle.database.get_store(ivle.config.Config())
61
 
users = store.find(ivle.database.User).order_by(ivle.database.User.login)
 
59
try:
 
60
    db = ivle.db.DB()
 
61
    list = db.get_users()
 
62
except Exception, message:
 
63
    print "Error: " + str(message)
 
64
    sys.exit(1)
62
65
 
63
 
for user in users:
 
66
list.sort(key=lambda user: user.login)
 
67
for user in list:
64
68
    if justnames:
65
69
        print user.login
66
70
    else: