cosmetic: Right(s) have a __repr__
authorThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Mon, 7 May 2012 14:00:06 +0000 (16:00 +0200)
committerThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Mon, 7 May 2012 14:00:06 +0000 (16:00 +0200)
sfa/trust/rights.py

index eb0bb74..1b8baa4 100644 (file)
@@ -94,6 +94,8 @@ class Right:
         self.kind = kind
         self.delegate = delegate
 
+    def __repr__ (self): return "<Rgt:%s>"%self.kind
+
     ##
     # Test to see if this right object is allowed to perform an operation.
     # Returns True if the operation is allowed, False otherwise.
@@ -148,6 +150,8 @@ class Rights:
         if string:
             self.load_from_string(string)
 
+    def __repr__ (self): return "[" + " ".join( ["%s"%r for r in self.rights]) + "]"
+
     def is_empty(self):
         return self.rights == []