Change PTEntry to display name if it's set.
authorEvan Broder <broder@mit.edu>
Tue, 17 Mar 2009 23:23:22 +0000 (19:23 -0400)
committerEvan Broder <broder@mit.edu>
Tue, 17 Mar 2009 23:23:36 +0000 (19:23 -0400)
Signed-off-by: Evan Broder <broder@mit.edu>

afs/_pts.pyx

index 05d0877..4a134fc 100644 (file)
@@ -80,7 +80,10 @@ cdef class PTEntry:
     cdef public object name
 
     def __repr__(self):
-        return '<PTEntry: %s>' % self.id
+        if self.name != '':
+            return '<PTEntry: %s>' % self.name
+        else:
+            return '<PTEntry: PTS ID %s>' % self.id
 
 cdef int _ptentry_from_checkentry(PTEntry p_entry, prcheckentry c_entry) except -1:
     if p_entry is None: