Changeset 3003

Show
Ignore:
Timestamp:
03/29/07 22:20:31 (2 years ago)
Author:
paul
Message:

Changed the repr of dObject to print the module and classname if there
isn't a valid Name of the object. I was seeing:

bizCustomers = BizCustomers?()
bizOrders = BizOrders?()
print bizCustomers
<(class dabo.biz.dBizobj)>
print bizOrders
<(class dabo.biz.dBizobj)>

Not really enough to go on.

Also, changed "class" to "baseclass" to reflect reality.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/dabo/dObject.py

    r2936 r3003  
    8686            classparts.pop() 
    8787        classname = ".".join(classparts) 
    88         spc = " " 
    8988        try: 
    9089            nm = self.Name 
     
    9291            nm = "" 
    9392        if (not nm) or (nm == "?"): 
    94             # No name 
    95             nm = spc = "" 
    96         return "<%(nm)s%(spc)s(class %(classname)s)>" % locals() 
     93            # No name; use module.classname 
     94            nm = "%s.%s" % (self.__class__.__module__, self.__class__.__name__) 
     95        return "<%(nm)s (baseclass %(classname)s)>" % locals() 
    9796         
    9897