[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnue] r8439 - trunk/gnue-common/src/definitions
From: |
reinhard |
Subject: |
[gnue] r8439 - trunk/gnue-common/src/definitions |
Date: |
Wed, 19 Apr 2006 16:46:27 -0500 (CDT) |
Author: reinhard
Date: 2006-04-19 16:46:27 -0500 (Wed, 19 Apr 2006)
New Revision: 8439
Modified:
trunk/gnue-common/src/definitions/GObjects.py
Log:
Removed unused and obsolete class GParserMultiplexor.
Modified: trunk/gnue-common/src/definitions/GObjects.py
===================================================================
--- trunk/gnue-common/src/definitions/GObjects.py 2006-04-19 16:06:56 UTC
(rev 8438)
+++ trunk/gnue-common/src/definitions/GObjects.py 2006-04-19 21:46:27 UTC
(rev 8439)
@@ -25,7 +25,7 @@
Base class for GNUe objects which can be represented as XML
"""
-__all__ = ['GObj', 'ParserMultiplexor', 'GUndividedCollection']
+__all__ = ['GObj', 'GUndividedCollection']
from xml.sax import saxutils
from gnue.common.definitions.GParserHelpers import GContent, ParserObj
@@ -554,62 +554,7 @@
return xmlString
-
# =============================================================================
-# ParserMultiplexor
-# =============================================================================
-
-class ParserMultiplexor (ParserObj):
- """
- When a GParser's BaseClass needs to be dependent upon an attribute, the tool
- can use a customized ParserMultiplexor, overwriting the getClass method.
-
- e.g., assume we have a XML tag 'goblin', that corresponds to a GObj-based
- class Goblin. However, if <goblin style="boo"> we really need a BooGoblin
- object or if <goblin style="foo"> then we need a FooBoblin object, then the a
- GoblinPlexor would define getClass as::
- def getClass (self):
- if self.style == 'boo':
- return BooGoblin
- elif self.style == 'foo':
- return FooGoblin
- else:
- return Goblin
- """
-
- # ---------------------------------------------------------------------------
- # Build an object
- # ---------------------------------------------------------------------------
-
- def _buildObject (self):
-
- newObj = self.getClass ()(None)
- for attr, value in self.__dict__.items ():
- if attr not in ('_buildObject', 'getClass') and attr [:2] != '__':
- newObj.__dict__ [attr] = value
-
- parent = self.getParent ()
- if parent:
- parent._children [parent._children.find (self)] = newObj
-
- return newObj._buildObject (self)
-
-
- # ---------------------------------------------------------------------------
- # This should return a GObj-based class
- # ---------------------------------------------------------------------------
-
- def getClass (self):
- """
- Get the actual class to instanciate for this XML element
-
- @returns: class to be used for this XML element
- """
-
- raise "Virtual method not implemented"
-
-
-# =============================================================================
# Collection class where the children in a diff won't get divided
# =============================================================================
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gnue] r8439 - trunk/gnue-common/src/definitions,
reinhard <=