Changeset View
Changeset View
Standalone View
Standalone View
pykolab/cli/cmd_user_info.py
Show First 20 Lines • Show All 49 Lines • ▼ Show 20 Lines | def execute(*args, **kw): | ||||
user_info = wap_client.user_find({'mail':user}) | user_info = wap_client.user_find({'mail':user}) | ||||
if user_info == None or not user_info: | if user_info == None or not user_info: | ||||
print(_("No such user %s") % (user), file=sys.stderr) | print(_("No such user %s") % (user), file=sys.stderr) | ||||
sys.exit(0) | sys.exit(0) | ||||
unic_attrs = ['displayname', 'givenname', 'cn', 'sn', 'ou', 'entrydn'] | unic_attrs = ['displayname', 'givenname', 'cn', 'sn', 'ou', 'entrydn'] | ||||
for (k,v) in user_info.iteritems(): | for (k,v) in user_info.items(): | ||||
if k in unic_attrs: | if k in unic_attrs: | ||||
print("%s: %s" % (k,v)) | print("%s: %s" % (k,v)) | ||||
else: | else: | ||||
print("%s: %r" % (k,v)) | print("%s: %r" % (k,v)) |