From: Alex Dehnert Date: Mon, 8 Feb 2010 05:16:57 +0000 (-0500) Subject: More functional card-access script X-Git-Url: https://www.dehnerts.com/gitweb/?p=user%2Falex%2Fsoftware%2Fmy-snippets.git;a=commitdiff_plain;h=3c566d839c1f5c812c0a1969bc9d9b3650bbcc11 More functional card-access script --- diff --git a/card-access b/card-access index 98cb2e9..2362720 100755 --- a/card-access +++ b/card-access @@ -31,7 +31,7 @@ def get_ldap_data(username, fields): def get_data_dict(line_dict): email = line_dict['email'] - username = email.replace('@mit.edu', '').lower() + username = email.lower().replace('@mit.edu', '') ldap = get_ldap_data(username, [ 'cn' , 'sn' , 'givenName' ]) first = ldap['givenName'].replace(' ', '_').upper() last = ldap['sn'].replace(' ', '_').upper() @@ -54,7 +54,7 @@ def do_produce_card_info(db = sys.stdin): for line in reader: line_dict = dictize_line(header, line) - #print line_dict + print line_dict lines.append(format_line(get_data_dict(line_dict))) print '\n'.join(lines)