Changeset 290
- Timestamp:
- 09/24/02 02:14:45 (6 years ago)
- Files:
-
- trunk/RBFoundation/RBFoundation/Acquisition.py (modified) (4 diffs)
- trunk/RBFoundation/RBFoundation/AttributedDict.py (modified) (3 diffs)
- trunk/RBFoundation/RBFoundation/ChainedDict.py (modified) (3 diffs)
- trunk/RBFoundation/RBFoundation/ContextApply.py (modified) (6 diffs)
- trunk/RBFoundation/RBFoundation/LazyProperty.py (modified) (1 diff)
- trunk/RBFoundation/RBFoundation/Utilities.py (modified) (1 diff)
- trunk/RBFoundation/RBFoundation/WeakBind.py (modified) (11 diffs)
- trunk/RBFoundation/RBFoundation/__init__.py (modified) (1 diff)
- trunk/RBFoundation/test (added)
- trunk/RBFoundation/test/test_doctests.py (added)
- trunk/RBSkinning/RBSkinning/wxPythonSkin/splitter.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/RBFoundation/RBFoundation/Acquisition.py
r253 r290 64 64 """Removes attribute from self if exists, or from an aquirable object.""" 65 65 try: 66 super(AcquisitionHooks, self).__getattribute__(name)66 return super(AcquisitionHooks, self).__delattr__(name) 67 67 except AttributeError: 68 success, result = self._DelAcquirableAttr(name , value)68 success, result = self._DelAcquirableAttr(name) 69 69 if success: return result 70 return super(AcquisitionHooks, self).__delattr__(name)70 else: raise 71 71 72 72 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 73 73 74 74 class SingleAcquisitionMixin(AcquisitionHooks): 75 """Allows for dynamic pseudo inheritence from a list of 'acquirable' objects.""" 75 """Allows for dynamic pseudo inheritence from a list of 'acquirable' objects. 76 77 >>> a = SingleAcquisitionMixin() 78 >>> class temp(object): 79 ... v = 1 80 ... u = 2 81 ... 82 >>> t = temp() 83 >>> a.SetAcquirable(t) 84 >>> a.v 85 1 86 >>> a.u 87 2 88 >>> a.u = 'a new value' 89 >>> a.u 90 'a new value' 91 >>> a.new_val = 'test new value' 92 >>> a.new_val 93 'test new value' 94 >>> vars(a).keys() 95 ['new_val', '_SingleAcquisitionMixin__AcquirableObject'] 96 >>> vars(t).keys() 97 ['u'] 98 >>> vars(t.__class__).keys() 99 ['__module__', 'u', 'v', '__dict__', '__weakref__', '__doc__'] 100 """ 76 101 77 102 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ … … 116 141 117 142 class AcquisitionMixin(AcquisitionHooks): 118 """Allows for dynamic pseudo inheritence from a list of 'acquirable' objects.""" 143 """Allows for dynamic pseudo inheritence from a list of 'acquirable' objects. 144 145 >>> a = AcquisitionMixin() 146 >>> class temp(object): 147 ... v = 1 148 ... u = 2 149 ... 150 >>> t = temp() 151 >>> a.AddAcquirable(t) 152 >>> a.v 153 1 154 >>> a.u 155 2 156 >>> a.u = 'a new value' 157 >>> a.u 158 'a new value' 159 >>> a.new_val = 'test new value' 160 >>> a.new_val 161 'test new value' 162 >>> vars(a).keys() 163 ['new_val', '_AcquisitionMixin__AcquirableObjects'] 164 >>> vars(t).keys() 165 ['u'] 166 >>> vars(t.__class__).keys() 167 ['__module__', 'u', 'v', '__dict__', '__weakref__', '__doc__'] 168 >>> class temp2(object): 169 ... q = 'r' 170 ... s = 't' 171 ... v = 'From temp2' 172 ... 173 >>> a.AddAcquirable(temp2()) 174 >>> a.q 175 'r' 176 >>> a.s 177 't' 178 >>> a.v 179 1 180 >>> a.v = 23 181 >>> a.v 182 23 183 >>> del a.v 184 >>> a.v 185 1 186 """ 119 187 120 188 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ … … 142 210 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 143 211 212 __invalid = id(None) 213 144 214 def _GetAcquirableAttr(self, name): 145 215 for x in self.__AcquirableObjects: 146 result = getattr(x, name, id(None))147 if result != id(None):216 result = getattr(x, name, self.__invalid) 217 if result != self.__invalid: 148 218 return 1, result 149 219 return 0, None … … 174 244 a.AddAcquirable(temp()) 175 245 176 if 1: 177 assert a.v == 1 178 assert a.u == 2 179 assert a.u != a.v 180 a.u = 'new value' 181 assert a.u == 'new value' 182 a.new_val = 'a new value!' 183 assert a.new_val == 'a new value!' 184 185 import time 186 count = 1e4 187 start = time.clock() 188 for i in xrange(count): me = i + temp.v 189 pereach = (time.clock() - start) / count 190 print "Normal:", pereach, "per", count 191 192 start = time.clock() 193 for i in xrange(count): me = i + a.v 194 pereach2 = (time.clock() - start) / count 195 print "Acquisition:", pereach2, "per", count 196 197 print "Acquisition is", pereach2/pereach, "times slower" 246 assert a.v == 1 247 assert a.u == 2 248 assert a.u != a.v 249 a.u = 'new value' 250 assert a.u == 'new value' 251 a.new_val = 'a new value!' 252 assert a.new_val == 'a new value!' 253 254 import time 255 count = 1e4 256 start = time.clock() 257 for i in xrange(count): me = i + temp.v 258 pereach = (time.clock() - start) / count 259 print "Normal:", pereach, "per", count 260 261 start = time.clock() 262 for i in xrange(count): me = i + a.v 263 pereach2 = (time.clock() - start) / count 264 print "Acquisition:", pereach2, "per", count 265 266 print "Acquisition is", pereach2/pereach, "times slower" 267 268 print 269 import doctest, Acquisition 270 doctest.testmod(Acquisition) 271 198 272 print "Test complete." 199 273 trunk/RBFoundation/RBFoundation/AttributedDict.py
r253 r290 27 27 """AttributedDict is intended to be a handly little class that you can 28 28 stuff attributes and such into like you would any other class, yet have 29 the nice iteration capabilities of a dictionary.""" 29 the nice iteration capabilities of a dictionary. 30 31 >>> test = AttributedDict() 32 >>> test.fun 33 Traceback (most recent call last): 34 AttributeError: 'AttributedDict' object has no attribute 'fun' 35 >>> test.fun = 7 36 >>> test.fun 37 7 38 >>> test.items() 39 [('fun', 7)] 40 >>> test.more = test.fun * 3 41 >>> test 42 {'fun': 7, 'more': 21} 43 >>> testupdate = {'regular':'dict'} 44 >>> testupdate.update(test) 45 >>> testupdate 46 {'fun': 7, 'regular': 'dict', 'more': 21} 47 >>> test.more 48 21 49 >>> test.regular 50 Traceback (most recent call last): 51 AttributeError: 'AttributedDict' object has no attribute 'regular' 52 >>> test.update(testupdate) 53 >>> test.regular 54 'dict' 55 >>> test 56 {'fun': 7, 'regular': 'dict', 'more': 21} 57 58 """ 30 59 31 60 __slots__ = [] # we really didnt want any attributes anyway … … 61 90 62 91 if __name__ == '__main__': 92 print "Testing..." 93 63 94 class _test(AttributedDict): 64 95 answer = 42 … … 108 139 109 140 print "Attributed Dict is", pereach2/pereach, "times slower" 141 142 print 143 print 144 145 import doctest, ChainedDict 146 doctest.testmod(ChainedDict) 147 148 print "Test complete." trunk/RBFoundation/RBFoundation/ChainedDict.py
r280 r290 19 19 ##~ 20 20 ##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 21 22 """Implements a dictionary-like with failover to a secondary dictionary-like object. 23 24 Useful for acquisition. =) 25 26 >>> cd = ChainedDict({'testing': 1}) 27 >>> cd.SetChained({'testing': 21, 'chained': 42}) 28 >>> cd.source 29 {'testing': 1} 30 >>> cd.chained 31 {'testing': 21, 'chained': 42} 32 >>> cd.items() 33 [('testing', 1)] 34 >>> cd.items(include_chained=1) 35 [('testing', 1), ('chained', 42)] 36 >>> cd['testing'] == 1 37 1 38 >>> cd['chained'] == 42 39 1 40 >>> del cd['testing'] 41 >>> cd['testing'] == 21 42 1 43 >>> cd['testing'] = 37 44 >>> cd.items(include_chained=1) 45 [('testing', 37), ('chained', 42)] 46 >>> cd.items() 47 [('testing', 37)] 48 >>> cd['testing'] == 37 49 1 50 >>> cd.get('testing', None) == 37 51 1 52 >>> del cd['testing'] 53 >>> cd['testing'] == 21 54 1 55 >>> 'testing' in cd 56 1 57 >>> 'chained' in cd 58 1 59 >>> 'not_there' not in cd 60 1 61 >>> cd.get('testing', None) == 21 62 1 63 >>> cd.get('chained', None) == 42 64 1 65 >>> cd.items() 66 [] 67 >>> cd.items(include_chained=1) 68 [('testing', 21), ('chained', 42)] 69 70 """ 21 71 22 72 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ … … 141 191 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 142 192 193 143 194 if __name__=='__main__': 195 print "Testing..." 144 196 print 145 197 … … 180 232 print cd.items(include_chained=1) 181 233 print 234 235 import doctest, ChainedDict 236 doctest.testmod(ChainedDict) 237 238 print "Test complete." 239 240 trunk/RBFoundation/RBFoundation/ContextApply.py
r280 r290 20 20 ##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 21 21 22 """Binds calling variables to a callable object, with ordering options. 23 24 >>> def _TestReturnArgsKw(*args, **kw): 25 ... return args, kw 26 ... 27 >>> fn = ContextApply(_TestReturnArgsKw, 2,3,5, seven='11') 28 >>> fn(13,17,19,twenty='3') 29 ((13, 17, 19, 2, 3, 5), {'twenty': '3', 'seven': '11'}) 30 >>> fn = ContextApply_p_s(_TestReturnArgsKw, 2,3,5, seven='11') 31 >>> fn(13,17,19,twenty='3') 32 ((13, 17, 19, 2, 3, 5), {'twenty': '3', 'seven': '11'}) 33 >>> fn = ContextApply_s_p(_TestReturnArgsKw, 2,3,5, seven='11') 34 >>> fn(13,17,19,twenty='3') 35 ((2, 3, 5, 13, 17, 19), {'twenty': '3', 'seven': '11'}) 36 >>> fn = ContextApply_p(_TestReturnArgsKw, 2,3,5, seven='11') 37 >>> fn(13,17,19,twenty='3') 38 ((13, 17, 19), {'twenty': '3'}) 39 >>> fn = ContextApply_s(_TestReturnArgsKw, 2,3,5, seven='11') 40 >>> fn(13,17,19,twenty='3') 41 ((2, 3, 5), {'seven': '11'}) 42 >>> fn = ContextApply_0(_TestReturnArgsKw, 2,3,5, seven='11') 43 >>> fn(13,17,19,twenty='3') 44 ((), {}) 45 """ 46 22 47 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 23 48 #~ Imports … … 38 63 39 64 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 65 #~ Test Utilities 66 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 67 68 def _TestReturnArgsKw(*args, **kw): 69 return args, kw 70 71 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 40 72 #~ Default Smart Apply Class 41 73 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ … … 71 103 - Passed from calling code, 72 104 - Saved context, 105 106 73 107 """ 74 108 def __call__(self, *args, **kw): … … 144 178 145 179 Note: Implementation of the composite pattern. 180 181 >>> import operator 182 >>> multi = MultipleApply(None, [operator.add, operator.mul, operator.mod]) 183 >>> multi(3,4) 184 [7, 12, 3] 185 146 186 """ 147 187 def __init__(self, idx=-1, *args, **kw): … … 173 213 174 214 if __name__ == '__main__': 215 print "Testing..." 216 217 import doctest, ContextApply 218 doctest.testmod(ContextApply) 219 175 220 from pprint import pprint 176 221 … … 210 255 assert multi(3,4) == ((3,4), {}) 211 256 257 print "Test complete." trunk/RBFoundation/RBFoundation/LazyProperty.py
r284 r290 19 19 ##~ 20 20 ##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 21 22 """ 23 >>> class Test(object): 24 ... p = LazyProperty('t', dict) 25 ... 26 >>> t = Test() 27 >>> vars(t) 28 {} 29 >>> t.p 30 {} 31 >>> t.p is not Test.p 32 1 33 >>> vars(t) 34 {'_lazy_t': {}} 35 36 """ 21 37 22 38 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ trunk/RBFoundation/RBFoundation/Utilities.py
r263 r290 26 26 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 27 27 28 def cleanupstrlst(datalst ):29 return filter(None, map(str.strip, datalst))28 def cleanupstrlst(datalst, FilterResult=0): 29 """Strips characters from a list of strings, and drops subsequent empty strings. 30 30 31 def joinclean(joinstr, data): 31 >>> cleanupstrlst([" this ", " is ", " \\t fun \\t \\r", " \\n \\r \\t test\\t\\t"]) 32 ['this', 'is', 'fun', 'test'] 33 """ 34 result = map(str.strip, datalst) 35 if FilterResult: 36 return filter(None, result) 37 else: return result 38 39 def joinclean(joinstr, data, *args, **kw): 40 """Uses cleanupstrlst, then joins the result using joinstr. 41 If data is simply a string, then the data is splitup using strtolist. 42 43 >>> joinclean(".", [" this ", " is ", " \\t fun \\t \\r", " \\n \\r \\t test\\t\\t"]) 44 'this.is.fun.test' 45 >>> joinclean("-", "data, , fun , data , oh\\t\\t\\t ,please \\t, \\r\\n can \\t , I have more data! ") 46 'data--fun-data-oh-please-can-I have more data!' 47 48 """ 32 49 if isinstance(data, list): 33 return joinstr.join(cleanupstrlst(data ))50 return joinstr.join(cleanupstrlst(data, *args, **kw)) 34 51 elif isinstance(data, (str, unicode)): 35 return joinstr.join(strtolist(data ))52 return joinstr.join(strtolist(data, *args, **kw)) 36 53 37 def strtolist(data, splitchar=',' ):38 return cleanupstrlst(data.split(','))54 def strtolist(data, splitchar=',', *args, **kw): 55 """Splits a dilimited string, then runs the result through cleanupstrlst. 39 56 57 >>> strtolist("data, , fun , data , oh\\t\\t\\t ,please \\t, \\r\\n can \\t , I have more data! ") 58 ['data', '', 'fun', 'data', 'oh', 'please', 'can', 'I have more data!'] 59 """ 60 61 return cleanupstrlst(data.split(splitchar), *args, **kw) 62 63 64 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 65 #~ Testing 66 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 67 68 if __name__=='__main__': 69 print "Testing..." 70 import doctest, Utilities 71 doctest.testmod(Utilities) 72 print "Test complete." 73 74 trunk/RBFoundation/RBFoundation/WeakBind.py
r286 r290 31 31 import weakref 32 32 import types 33 from AspectOriented.Aspect import Aspect as _Aspect 33 34 34 35 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ … … 37 38 38 39 typesBindMethods = (types.MethodType, types.BuiltinMethodType ) 39 typesRequireBinding = typesBindMethods + (types.ObjectType, types.InstanceType) 40 typesInstances = (types.ObjectType, types.InstanceType) 41 typesRequireBinding = typesBindMethods + typesInstances 40 42 41 43 typesNonBindMethods = (types.FunctionType, types.LambdaType, types.GeneratorType, types.BuiltinFunctionType) … … 43 45 44 46 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 47 #~ Callable Aspects 48 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 49 50 ##class _CallableFuctionAspect(_Aspect): 51 ## def __nonzero__(self): return self.im_func and 1 or 0 52 ## def __hash__(self): return hash(self.im_func) 53 ## def _DoCall(self, *args, **kw): 54 ## return self.im_func(*args, **kw) 55 ## __call__ = _DoCall 56 57 ##class _CallableMethodAspect(_Aspect): 58 ## def __nonzero__(self): return self.im_self() is not None and 1 or 0 59 ## def __hash__(self): return hash(self.im_self) 60 ## def _DoCall(self, *args, **kw): 61 ## im_self = self.im_self() 62 ## if im_self is None: raise weakref.ReferenceError, "weakly-referenced object no longer exists" 63 ## return self.im_func(im_self, *args, **kw) 64 ## __call__ = _DoCall 65 66 ##class _CallableInstanceAspect(_Aspect): 67 ## def __nonzero__(self): return self.im_self() is not None and 1 or 0 68 ## def __hash__(self): return hash(self.im_self) 69 ## def _DoCall(self, *args, **kw): 70 ## im_self = self.im_self() 71 ## if im_self is None: raise weakref.ReferenceError, "weakly-referenced object no longer exists" 72 ## return im_self(*args, **kw) 73 ## __call__ = _DoCall 74 75 #~ Test Utilities ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 76 77 def _PrintOnRelease(wr): 78 print "Released weakref" 79 80 class _TestObject(object): 81 def TestMethod(self, *args, **kw): 82 return args, kw 83 84 #~ Class Bases ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 45 85 46 86 class BoundCallableBase(object): … … 61 101 62 102 As a related sidenote, the ContextApply module builds upon this concepts to bind method variables 63 to bound-callable objects.""" 103 to bound-callable objects. 104 105 >>> t = _TestObject() 106 >>> wbc = WeakBoundCallable(t.TestMethod, _PrintOnRelease) 107 >>> wbc(1,2,3,four=4) 108 ((1, 2, 3), {'four': 4}) 109 >>> del t 110 Released weakref 111 112 """ 64 113 65 114 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ … … 82 131 # keep a hard reference to the BoundCallableBase 83 132 self.im_func = Callable 133 ##_CallableFuctionAspect.InsertAspect(self) 84 134 elif isinstance(Callable, typesBindMethods): 85 135 # Wrap up the method and potential instance 136 self.im_func = getattr(Callable, 'im_func', Callable) 86 137 if getattr(Callable, 'im_self', None) is not None: 87 138 self.im_self = weakref.ref(Callable.im_self, *weakrefArgs, **weakrefKw) 88 self.im_func = getattr(Callable, 'im_func', Callable) 139 ##_CallableMethodAspect.InsertAspect(self) 140 else: 141 ##_CallableFuctionAspect.InsertAspect(self) 142 pass 89 143 elif isinstance(Callable, typesInstances): 90 144 # This is a "callable object", make a weakref to it 91 145 self.im_self = weakref.ref(Callable, *weakrefArgs, **weakrefKw) 92 146 self.im_func = None 147 ##_CallableInstanceAspect.InsertAspect(self) 93 148 elif callable(Callable): 94 149 # What the heck is it? well... its supposed to be callable... 95 150 self.im_func = Callable 151 ##_CallableFuctionAspect.InsertAspect(self) 96 152 97 153 def __nonzero__(self): … … 133 189 __call__ = _DoCall 134 190 191 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 192 135 193 BoundCallable = WeakBoundCallable 136 194 … … 140 198 """Provides the same interface as WeakBoundCallable, but maintains strong references 141 199 to both class instances and callable objects. Used mainly in ContextApply to build 142 upon a common class interface.""" 200 upon a common class interface. 201 202 >>> t = _TestObject() 203 >>> sbc = StrongBoundCallable(t.TestMethod) 204 >>> sbc(1,2,3,four=4) 205 ((1, 2, 3), {'four': 4}) 206 """ 143 207 144 208 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ … … 161 225 return self.Callable is not None and 1 or 0 162 226 163 #def __call__(self, *args, **kw):164 # return self._DoCall(args, kw)227 def __hash__(self): 228 return hash(self.Callable) 165 229 166 230 def __eq__(self, other): … … 184 248 185 249 def BindCallable(Callable, BindClass=BoundCallable, *args, **kw): 186 """Binds a callable object using BindClass only if needed.""" 250 """Binds a callable object using BindClass only if needed. 251 252 >>> BindCallable(_PrintOnRelease) is _PrintOnRelease 253 1 254 >>> BindCallable(_TestObject.TestMethod) is not _TestObject.TestMethod 255 1 256 """ 187 257 if isinstance(Callable, BoundCallableBase): 188 258 # It's already bound in some form or another, … … 201 271 202 272 def WeakBindCallable(Callable, *args, **kw): 203 """Weakly binds a callable object only if needed.""" 273 """Weakly binds a callable object only if needed. 274 275 >>> WeakBindCallable(_TestObject.TestMethod) is not _TestObject.TestMethod 276 1 277 >>> WeakBindCallable(_TestObject().TestMethod) and 1 or 0 278 0 279 >>> t = _TestObject() 280 >>> wbc = WeakBindCallable(t.TestMethod) 281 >>> wbc is not t.TestMethod 282 1 283 >>> t.TestMethod() == wbc() 284 1 285 >>> del t 286 >>> wbc and 1 or 0 287 0 288 """ 204 289 return BindCallable(Callable, WeakBoundCallable, *args, **kw) 205 290 206 291 def StrongBindCallable(Callable, *args, **kw): 207 """Strongly binds a callable object only if needed.""" 292 """Strongly binds a callable object only if needed. 293 294 >>> StrongBindCallable(_TestObject.TestMethod) is not _TestObject.TestMethod 295 1 296 >>> StrongBindCallable(_TestObject().TestMethod) and 1 or 0 297 1 298 >>> t = _TestObject() 299 >>> sbc = StrongBindCallable(t.TestMethod) 300 >>> sbc is not t.TestMethod 301 1 302 >>> t.TestMethod() == sbc() 303 1 304 >>> del t 305 >>> sbc and 1 or 0 306 1 307 """ 208 308 return BindCallable(Callable, StrongBoundCallable, *args, **kw) 209 309 … … 214 314 if __name__ == '__main__': 215 315 print "Testing..." 316 import doctest, WeakBind 317 doctest.testmod(WeakBind) 318 216 319 import sys 217 320 trunk/RBFoundation/RBFoundation/__init__.py
r286 r290 46 46 """ 47 47 48 __version__ = '0.3. 2'48 __version__ = '0.3.3' 49 49 __author__ = 'Shane Holloway' 50 50 __author_email__ = 'shane.holloway@runeblade.com' trunk/RBSkinning/RBSkinning/wxPythonSkin/splitter.py
r277 r290 55 55 self.object = wx.wxSplitterWindow(winParent, **kwSettings) 56 56 self.SplitWindows = [] 57 self.wxInitialStandardOptions() 57 58 self.AddToLayout() 58 59 … … 66 67 elif self.settings['orientation'] == 'horizontal': 67 68 self.object.SplitHorizontally(self.SplitWindows[0], self.SplitWindows[1]) 68 self.wxInitialStandardOptions()69 69 70 70 def SkinFinalize(self):
