| 1 |
#!/usr/bin/env python |
|---|
| 2 |
##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|---|
| 3 |
##~ License |
|---|
| 4 |
##~ |
|---|
| 5 |
##- The RuneBlade Foundation library is intended to ease some |
|---|
| 6 |
##- aspects of writing intricate Jabber, XML, and User Interface (wxPython, etc.) |
|---|
| 7 |
##- applications, while providing the flexibility to modularly change the |
|---|
| 8 |
##- architecture. Enjoy. |
|---|
| 9 |
##~ |
|---|
| 10 |
##~ Copyright (C) 2002 TechGame Networks, LLC. |
|---|
| 11 |
##~ |
|---|
| 12 |
##~ This library is free software; you can redistribute it and/or |
|---|
| 13 |
##~ modify it under the terms of the BSD style License as found in the |
|---|
| 14 |
##~ LICENSE file included with this distribution. |
|---|
| 15 |
##~ |
|---|
| 16 |
##~ TechGame Networks, LLC can be reached at: |
|---|
| 17 |
##~ 3578 E. Hartsel Drive #211 |
|---|
| 18 |
##~ Colorado Springs, Colorado, USA, 80920 |
|---|
| 19 |
##~ |
|---|
| 20 |
##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|---|
| 21 |
|
|---|
| 22 |
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|---|
| 23 |
#~ Imports |
|---|
| 24 |
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|---|
| 25 |
|
|---|
| 26 |
from PySkinObject import PySkinObject |
|---|
| 27 |
from RBSkinning.UtilitySkinElements import IgnoreXML, StoreXML, RestoreStoredXMLMixin |
|---|
| 28 |
|
|---|
| 29 |
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|---|
| 30 |
#~ Definitions |
|---|
| 31 |
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|---|
| 32 |
|
|---|
| 33 |
class PyConditionalSkinObject(PySkinObject, RestoreStoredXMLMixin): |
|---|
| 34 |
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|---|
| 35 |
#~ Constants / Variables / Etc. |
|---|
| 36 |
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|---|
| 37 |
|
|---|
| 38 |
_ChildFactory = IgnoreXML |
|---|
| 39 |
_bStoreChildren = 0 |
|---|
| 40 |
|
|---|
| 41 |
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|---|
| 42 |
#~ XMLBuilderObjectBase Overrides |
|---|
| 43 |
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|---|
| 44 |
|
|---|
| 45 |
def __init__(self, owner, parent, node, attributes, namespacemap): |
|---|
| 46 |
PySkinObject.__init__(self, owner, parent, node, attributes, namespacemap) |
|---|
| 47 |
self.owner = owner |
|---|
| 48 |
|
|---|
| 49 |
def _xmlChildFactory(self, owner, parent, node, attributes, namespacemap): |
|---|
| 50 |
return self._ChildFactory |
|---|
| 51 |
|
|---|
| 52 |
def _addData(self, data): |
|---|
| 53 |
if self._bStoreChildren: |
|---|
| 54 |
return PySkinObject._addData(self, data) |
|---|
| 55 |
else: return None |
|---|
| 56 |
|
|---|
| 57 |
def _addElement(self, node, obj): |
|---|
| 58 |
if self._bStoreChildren: |
|---|
| 59 |
return PySkinObject._addElement(self, node, obj) |
|---|
| 60 |
else: return None |
|---|
| 61 |
|
|---|
| 62 |
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|---|
| 63 |
#~ Public Methods |
|---|
| 64 |
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|---|
| 65 |
|
|---|
| 66 |
def StoreChildren(self, flag=1): |
|---|
| 67 |
self._bStoreChildren = flag |
|---|
| 68 |
if flag: self._ChildFactory = StoreXML |
|---|
| 69 |
else: self._ChildFactory = IgnoreXML |
|---|
| 70 |
|
|---|
| 71 |
def SkinInitialize(self): |
|---|
| 72 |
pass |
|---|
| 73 |
|
|---|
| 74 |
def SkinFinalize(self): |
|---|
| 75 |
pass |
|---|
| 76 |
|
|---|