Author: jmorliaguet Date: Tue Oct 4 23:39:24 2005 New Revision: 27943 Modified: z3lab/cpsskins/branches/jmo-perspectives/relations/__init__.py z3lab/cpsskins/branches/jmo-perspectives/storage/relations.py Log:
- more readable __repr__() for relations Modified: z3lab/cpsskins/branches/jmo-perspectives/relations/__init__.py ============================================================================== --- z3lab/cpsskins/branches/jmo-perspectives/relations/__init__.py (original) +++ z3lab/cpsskins/branches/jmo-perspectives/relations/__init__.py Tue Oct 4 23:39:24 2005 @@ -237,7 +237,7 @@ def __repr__(self): predicate = str(self()).replace('_', '%s') - return "<Monadic relation: '%s'>" % (predicate % str(self.first)) + return "<Monadic relation: '%s'>" % (predicate % repr(self.first)) class DyadicRelation(Relation): @@ -287,7 +287,7 @@ def __repr__(self): predicate = str(self()).replace('_', '%s') return "<Dyadic relation: '%s'>" % ( - predicate % (str(self.first), str(self.second)) + predicate % (repr(self.first), repr(self.second)) ) @@ -346,7 +346,7 @@ def __repr__(self): predicate = str(self()).replace('_', '%s') return "<Triadic relation: '%s'>" % ( - predicate % (str(self.first), str(self.second), str(self.third)) + predicate % (repr(self.first), repr(self.second), repr(self.third)) ) class TestRelate: @@ -360,3 +360,6 @@ def __str__(self): return self.name + def __repr__(self): + return self.name + Modified: z3lab/cpsskins/branches/jmo-perspectives/storage/relations.py ============================================================================== --- z3lab/cpsskins/branches/jmo-perspectives/storage/relations.py (original) +++ z3lab/cpsskins/branches/jmo-perspectives/storage/relations.py Tue Oct 4 23:39:24 2005 @@ -238,8 +238,7 @@ relation_name = chooser.chooseName(name, relation) self[relation_name] = relation logger.log(DEBUG, - "Added a relation with id '%s' and predicate '%s' connecting %s" - % (relation_name, str(relation), list(relation)) + "Added a relation '%s'; '%s'" % (relation_name, repr(relation)) ) def remove(self, ids=[]): -- http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins