Changeset 82
- Timestamp:
- 04/02/02 23:58:49 (7 years ago)
- Files:
-
- trunk/RBFoundation/RBFoundation/WeakBind.py (modified) (3 diffs)
- trunk/RBFoundation/RBFoundation/XMLObjectify.py (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/RBFoundation/RBFoundation/WeakBind.py
r66 r82 48 48 assert(callable(callback)) 49 49 if isinstance(callback, (types.MethodType, types.UnboundMethodType)): 50 if callback.im_self :50 if callback.im_self is not None: 51 51 self.im_self = weakref.ref(callback.im_self) 52 52 self.im_func = callback.im_func … … 70 70 71 71 def _DoCall(self, args, kw): 72 #print 'self: %r, func: %r' % (self.im_self, self.im_func) 72 73 if self.im_self: 73 74 im_self = self.im_self() 74 if im_self :75 if im_self is not None: 75 76 if self.im_func: 76 77 return apply(self.im_func, (im_self,) + args, kw) … … 78 79 else: raise weakref.ReferenceError, "weakly-referenced object no longer exists" 79 80 else: return apply(self.im_func, args, kw) 80 #try:81 #except TypeError:82 # print "BindCallable Exception"83 # print 'im_func:', self.im_func84 # if self.im_self: print 'im_self():', self.im_self()85 # else: print 'im_self:', self.im_self86 # print 'args:', args87 # print 'kw:', kw88 # raise89 81 90 82 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ trunk/RBFoundation/RBFoundation/XMLObjectify.py
r76 r82 88 88 return ''.join(self()) 89 89 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 90 102 def __repr__(self): 91 103 result = object.__repr__(self) … … 135 147 def _xmlInitComplete(self): 136 148 pass #print '%r complete' % self 137 149 138 150 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 139 151 … … 141 153 objectified_class = _Objectified 142 154 Objectify = XMLBuilder.XMLBuilder.Parse 155 ObjectifyFile = XMLBuilder.XMLBuilder.ParseFile 143 156 144 157 def _GetElementFactory(self, owner, parent, namespace, node, attributes): … … 149 162 _defaultObjectifier = Objectifier() 150 163 Objectify = _defaultObjectifier.Objectify 164 ObjectifyFile = _defaultObjectifier.ObjectifyFile 151 165 152 166 if __name__ == '__main__':
