Changeset 259:f96d9d162699 in livinglogic.python.orasql

Show
Ignore:
Timestamp:
04/08/08 17:12:43 (12 years ago)
Author:
Walter Doerwald <walter@…>
Branch:
default
Message:

Add repr()s to exception classes.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/ll/orasql/__init__.py

    r252 r259  
    6767        self.obj = obj 
    6868 
     69    def __repr__(self): 
     70        return "<%s.%s obj=%r at 0x%x>" % (self.__class__.__module__, self.__class__.__name__, self.obj, id(self)) 
     71 
    6972    def __str__(self): 
    7073        return "%r not found" % self.obj 
     
    7679        self.owner = owner 
    7780 
     81    def __repr__(self): 
     82        return "<%s.%s name=%r owner=%r at 0x%x>" % (self.__class__.__module__, self.__class__.__name__, self.name, self.owner, id(self)) 
     83 
    7884    def __str__(self): 
    7985        if self.owner is None: 
     
    8793        self.mode = mode 
    8894 
     95    def __repr__(self): 
     96        return "<%s.%s mode=%r at 0x%x>" % (self.__class__.__module__, self.__class__.__name__, self.mode, id(self)) 
     97 
    8998    def __str__(self): 
    9099        return "unknown mode %r" % self.mode 
     
    94103    def __init__(self, schema): 
    95104        self.schema = schema 
     105 
     106    def __repr__(self): 
     107        return "<%s.%s schema=%r at 0x%x>" % (self.__class__.__module__, self.__class__.__name__, self.schema, id(self)) 
    96108 
    97109    def __str__(self): 
     
    103115        self.object = object 
    104116        self.message = message 
     117 
     118    def __repr__(self): 
     119        return "<%s.%s object=%r message=%r at 0x%x>" % (self.__class__.__module__, self.__class__.__name__, self.object, self.message, id(self)) 
    105120 
    106121    def __str__(self):