@@ -70,37 +70,37 @@ def search(query):
7070 row (rows , 'Name' , names )
7171
7272 if jhasattr (entry , 'uid' ):
73- row (rows , 'UID' , entry .get ("uid" ))
73+ row (rows , 'UID' , entry .get ("uid" )[ 0 ] )
7474
7575 if jhasattr (entry , 'uupid' ):
76- row (rows , 'PID' , entry .get ("uupid" ))
76+ row (rows , 'PID' , entry .get ("uupid" )[ 0 ] )
7777
7878 if jhasattr (entry , 'major' ):
79- row (rows , 'Major' , entry .get ("major" ))
79+ row (rows , 'Major' , entry .get ("major" )[ 0 ] )
8080 elif jhasattr (entry , 'department' ):
8181 row (rows , 'Department' , entry .get ("department" ))
8282
8383 if jhasattr (entry , 'title' ):
84- row (rows , 'Title' , entry .get ("title" ))
84+ row (rows , 'Title' , entry .get ("title" )[ 0 ] )
8585
8686 if jhasattr (entry , 'postalAddress' ):
8787 row (rows , 'Office' , parse_addr (entry .get ("postalAddress" )[0 ]))
8888
8989 if jhasattr (entry , 'mailStop' ):
90- row (rows , 'Mail Stop' , entry .get ("mailStop" ))
90+ row (rows , 'Mail Stop' , entry .get ("mailStop" )[ 0 ] )
9191
9292 if jhasattr (entry , 'telephoneNumber' ):
93- row (rows , 'Office Phone' , entry .get ("telephoneNumber" ))
93+ row (rows , 'Office Phone' , entry .get ("telephoneNumber" )[ 0 ] )
9494
9595 if jhasattr (entry , 'localPostalAddress' ):
9696 row (rows , 'Mailing Address' , parse_addr (
97- entry .get ("localPostalAddress" )))
97+ entry .get ("localPostalAddress" )[ 0 ] ))
9898
9999 if jhasattr (entry , 'localPhone' ):
100- row (rows , 'Phone Number' , entry .get ("localPhone" ))
100+ row (rows , 'Phone Number' , entry .get ("localPhone" )[ 0 ] )
101101
102102 if jhasattr (entry , 'mailPreferredAddress' ):
103- row (rows , 'Email Address' , entry .get ("mailPreferredAddress" ))
103+ row (rows , 'Email Address' , entry .get ("mailPreferredAddress" )[ 0 ] )
104104
105105 print ("\n " .join (rows ))
106106 print ()
0 commit comments