Changeset 82

Show
Ignore:
Timestamp:
04/02/02 23:58:49 (7 years ago)
Author:
sholloway
Message:

Bugfixes

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/RBFoundation/RBFoundation/WeakBind.py

    r66 r82  
    4848        assert(callable(callback)) 
    4949        if isinstance(callback, (types.MethodType, types.UnboundMethodType)): 
    50             if callback.im_self:  
     50            if callback.im_self is not None:  
    5151                self.im_self = weakref.ref(callback.im_self) 
    5252            self.im_func = callback.im_func 
     
    7070 
    7171    def _DoCall(self, args, kw): 
     72        #print 'self: %r, func: %r' % (self.im_self, self.im_func) 
    7273        if self.im_self: 
    7374            im_self = self.im_self() 
    74             if im_self:  
     75            if im_self is not None:  
    7576                if self.im_func: 
    7677                    return apply(self.im_func, (im_self,) + args, kw) 
     
    7879            else: raise weakref.ReferenceError, "weakly-referenced object no longer exists" 
    7980        else: return apply(self.im_func, args, kw) 
    80         #try: 
    81         #except TypeError: 
    82         #    print "BindCallable Exception" 
    83         #    print 'im_func:', self.im_func 
    84         #    if self.im_self: print 'im_self():', self.im_self() 
    85         #    else: print 'im_self:', self.im_self 
    86         #    print 'args:', args 
    87         #    print 'kw:', kw 
    88         #    raise 
    8981 
    9082#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
  • trunk/RBFoundation/RBFoundation/XMLObjectify.py

    r76 r82  
    8888        return ''.join(self()) 
    8989     
     90    def __int__(self):  
     91        return int(str(self)) 
     92 
     93    def __long__(self):  
     94        return long(str(self))  
     95 
     96    def __float__(self):  
     97        return float(str(self))  
     98 
     99    def __complex__(self):  
     100        return complex(str(self))  
     101 
    90102    def __repr__(self): 
    91103        result = object.__repr__(self) 
     
    135147    def _xmlInitComplete(self): 
    136148        pass #print '%r complete' % self 
    137      
     149 
    138150#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    139151     
     
    141153    objectified_class = _Objectified  
    142154    Objectify = XMLBuilder.XMLBuilder.Parse 
     155    ObjectifyFile = XMLBuilder.XMLBuilder.ParseFile 
    143156 
    144157    def _GetElementFactory(self, owner, parent, namespace, node, attributes): 
     
    149162_defaultObjectifier = Objectifier() 
    150163Objectify = _defaultObjectifier.Objectify 
     164ObjectifyFile = _defaultObjectifier.ObjectifyFile 
    151165 
    152166if __name__ == '__main__':