Changeset 175
- Timestamp:
- 06/17/02 20:42:53 (6 years ago)
- Files:
-
- trunk/RBFoundation/RBFoundation/ObjectifiedXMLParser.py (modified) (4 diffs)
- trunk/RBFoundation/RBFoundation/WeakBind.py (modified) (4 diffs)
- trunk/RBSkinning/RBSkinning/wxPythonSkin/status.html (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/RBFoundation/RBFoundation/ObjectifiedXMLParser.py
r164 r175 36 36 37 37 from xml.parsers.expat import ParserCreate as _ParserCreate 38 from WeakBind import BindCallable 38 39 39 40 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ … … 42 43 43 44 class LazyExpatXMLParser(object): 45 """Use Expat parser to parse string/file data, but create the 46 parser as late as possible.""" 44 47 def __init__(self, encoding='ASCII', seperator=' '): 45 48 self._encoding = encoding … … 50 53 parser = _ParserCreate(self._encoding, self._seperator) 51 54 parser.returns_unicode = self._encoding != 'ASCII' and 1 or 0 52 parser.StartElementHandler = self.StartElementHandler53 parser.EndElementHandler = self.EndElementHandler54 parser.CharacterDataHandler = self.CharacterDataHandler55 parser.StartElementHandler = BindCallable(self.StartElementHandler) 56 parser.EndElementHandler = BindCallable(self.EndElementHandler) 57 parser.CharacterDataHandler = BindCallable(self.CharacterDataHandler) 55 58 return parser.Parse(*args, **kw) 56 59 … … 67 70 68 71 class ObjectifiedXMLParser(LazyExpatXMLParser): 72 """Mimics the events of the Expat parser with an Objectifed XML 73 object as the source data. Builds on LazyExpatXMLParser in case 74 the passed in data is in string form.""" 69 75 def Parse(self, obj, *args, **kw): 70 if not isinstance(obj, str): 76 if not isinstance(obj, str): 71 77 # Here's the magic... reuse the already objectified XML 72 78 name = self._seperator.join([obj.__namespace__, obj.__node__]) trunk/RBFoundation/RBFoundation/WeakBind.py
r164 r175 31 31 ##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 32 32 33 """weakref for callable objects. 34 35 See WeakBoundCallable and BindCallable for more details 36 """ 37 33 38 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 34 39 #~ Imports … … 56 61 57 62 class WeakBoundCallable(BoundCallableBase): 63 """weakref for callable objects. 64 65 Weakref objects have become a matter of necessity for managing the scope of interconnected 66 networks of objects, defining owner and owned, while still allow for reference loops. 67 However, weakref-ing a bound method always returns a dead weakref, but true references keep 68 the "owner" class around. WeakBoundCallable's intention is to provide weakref-type support 69 for bound methods, as well as all other callable objects. 70 71 As a related sidenote, the ContextApply module builds upon this concepts to bind method variables 72 to bound-callable objects.""" 73 58 74 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 59 75 #~ Constants / Variables / Etc. … … 122 138 123 139 class StrongBoundCallable(BoundCallableBase): 140 """Provides the same interface as WeakBoundCallable, but maintains strong references 141 to both class instances and callable objects. Used mainly in ContextApply to build 142 upon a common class interface.""" 143 124 144 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 125 145 #~ Constants / Variables / Etc. … … 160 180 161 181 def BindCallable(callback): 182 """Weakly binds a callable object only if needed.""" 162 183 if isinstance(callback, BoundCallableBase): 163 184 # It's already bound in some form or another, trunk/RBSkinning/RBSkinning/wxPythonSkin/status.html
r174 r175 2 2 <body> 3 3 <table> 4 <tr><td><b>Special:</b><td>Complete<td>Needed<td>Wanted<td> WhyIsItHere4 <tr><td><b>Special:</b><td>Complete<td>Needed<td>Wanted<td>NotPlanned 5 5 <tr><td>PyCrust: crust, shell, filling<td>1<td>-<td>-<td>- 6 6 <tr><td>wxStyledTextCtrl<td>1<td>-<td>-<td>- 7 7 <tr><td>Transform wxEventSystem<td>1<td>-<td>-<td>- 8 8 9 <tr><td><b>Frame:</b><td>Complete<td>Needed<td>Wanted<td> WhyIsItHere9 <tr><td><b>Frame:</b><td>Complete<td>Needed<td>Wanted<td>NotPlanned 10 10 <tr><td>wxFrame<td>1<td>-<td>-<td>- 11 11 <tr><td>wxMiniFrame<td>1<td>-<td>-<td>- … … 13 13 <tr><td>wxMDIParentFrame<td>1<td>-<td>-<td>- 14 14 15 <tr><td><b>Dialogs:</b><td>Complete<td>Needed<td>Wanted<td> WhyIsItHere15 <tr><td><b>Dialogs:</b><td>Complete<td>Needed<td>Wanted<td>NotPlanned 16 16 <tr><td>wxDialog<td>1<td>-<td>-<td>- 17 17 <tr><td>wxWizard<td>-<td>-<td>1<td>- … … 19 19 <tr><td>wxWizardPageSimple<td>-<td>-<td>1<td>- 20 20 21 <tr><td><b>Container Windows:</b><td>Complete<td>Needed<td>Wanted<td> WhyIsItHere21 <tr><td><b>Container Windows:</b><td>Complete<td>Needed<td>Wanted<td>NotPlanned 22 22 <tr><td>wxPopupWindow<td>-<td>-<td>-<td>1 23 23 <tr><td>wxPopupTransientWindow<td>-<td>-<td>-<td>1 … … 30 30 <tr><td>wxPanel<td>1<td>-<td>-<td>- 31 31 32 <tr><td><b>Bars:</b><td>Complete<td>Needed<td>Wanted<td> WhyIsItHere32 <tr><td><b>Bars:</b><td>Complete<td>Needed<td>Wanted<td>NotPlanned 33 33 <tr><td>wxMenuBar<td>1<td>-<td>-<td>- 34 34 <tr><td>wxToolBar<td>-<td>-<td>1<td>- 35 35 <tr><td>wxStatusBar<td>1<td>-<td>-<td>- 36 36 37 <tr><td><b>Widgets:</b><td>Complete<td>Needed<td>Wanted<td> WhyIsItHere37 <tr><td><b>Widgets:</b><td>Complete<td>Needed<td>Wanted<td>NotPlanned 38 38 <tr><td>wxGrid<td>1<td>-<td>-<td>- 39 39 <tr><td>wxHtmlWindow<td>-<td>-<td>1<td>- … … 49 49 <tr><td>wxListCtrl<td>1<td>-<td>-<td>- 50 50 <tr><td>wxTextCtrl<td>1<td>-<td>-<td>- 51 <tr><td>wxTa Ctrl<td>-<td>-<td>-<td>151 <tr><td>wxTabCtrl<td>-<td>-<td>-<td>1 52 52 <tr><td>wxTreeCtrl<td>1<td>-<td>-<td>- 53 53 <tr><td>wxScrollBar<td>-<td>-<td>1<td>- … … 63 63 <tr><td>wxLEDNumberCtrl<td>-<td>-<td>-<td>1 64 64 65 <tr><td><b>User Interaction:</b><td>Complete<td>Needed<td>Wanted<td> WhyIsItHere65 <tr><td><b>User Interaction:</b><td>Complete<td>Needed<td>Wanted<td>NotPlanned 66 66 <tr><td>wxMenu<td>1<td>-<td>-<td>- 67 67 <tr><td>wxMenuItem<td>1<td>-<td>-<td>- 68 68 <tr><td>wxAcceleratorTable<td>-<td>1<td>-<td>- 69 69 70 <tr><td><b>Layout:</b><td>Complete<td>Needed<td>Wanted<td> WhyIsItHere70 <tr><td><b>Layout:</b><td>Complete<td>Needed<td>Wanted<td>NotPlanned 71 71 <tr><td>wxLayoutConstraints<td>-<td>-<td>-<td>1 72 72 <tr><td>wxIndividualLayoutConstraint<td>-<td>-<td>-<td>1 73 73 <tr><td>wxSizers<td>1<td>-<td>-<td>- 74 <tr><td>wxLayoutAlgorithm<td> -<td>-<td>-<td>174 <tr><td>wxLayoutAlgorithm<td>1<td>-<td>-<td>- 75 75 <tr><td>LayoutAnchors (from wxPython.lib.anchors)<td>-<td>-<td>1<td>- 76 76 77 <tr><td><b>Graphics:</b><td>Complete<td>Needed<td>Wanted<td> WhyIsItHere77 <tr><td><b>Graphics:</b><td>Complete<td>Needed<td>Wanted<td>NotPlanned 78 78 <tr><td>wxFont<td>-<td>-<td>1<td>- 79 79 <tr><td>wxFontList<td>-<td>-<td>1<td>- … … 83 83 <tr><td>wxMask<td>-<td>-<td>1<td>- 84 84 85 <tr><td><b>Misc:</b><td>Complete<td>Needed<td>Wanted<td> WhyIsItHere85 <tr><td><b>Misc:</b><td>Complete<td>Needed<td>Wanted<td>NotPlanned 86 86 <tr><td>wxApplication<td>1<td>-<td>-<td>- 87 87 <tr><td>wxTimer<td>-<td>-<td>1<td>- 88 88 <tr><td>wxGLCanvas<td>1<td>-<td>-<td>- 89 <tr><td>wxOGL<td> -<td>-<td>1<td>-89 <tr><td>wxOGL<td>1<td>-<td>-<td>- 90 90 <tr><td>wxJoystick<td>-<td>-<td>1<td>- 91 91 <tr><td>SplitTree<td>-<td>-<td>-<td>1
