[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnue] r8429 - trunk/gnue-common/src/logic
From: |
reinhard |
Subject: |
[gnue] r8429 - trunk/gnue-common/src/logic |
Date: |
Wed, 19 Apr 2006 05:32:18 -0500 (CDT) |
Author: reinhard
Date: 2006-04-19 05:32:17 -0500 (Wed, 19 Apr 2006)
New Revision: 8429
Modified:
trunk/gnue-common/src/logic/GTrigger.py
Log:
Removed completely redundant implementation of _dumpXML_
Modified: trunk/gnue-common/src/logic/GTrigger.py
===================================================================
--- trunk/gnue-common/src/logic/GTrigger.py 2006-04-19 10:31:30 UTC (rev
8428)
+++ trunk/gnue-common/src/logic/GTrigger.py 2006-04-19 10:32:17 UTC (rev
8429)
@@ -74,6 +74,8 @@
GObj.__init__(self, parent, 'GCTrigger')
+ self._xml_content_as_cdata_ = gConfig('StoreTriggersAsCDATA')
+
self.__root = self.findParentOfType(None)
self._inits = [None,self.initialize,self.initCall]
@@ -179,84 +181,6 @@
return string.upper(self.type)
- # ---------------------------------------------------------------------------
- # Dump a XML representation of a trigger
- # ---------------------------------------------------------------------------
-
- def _dumpXML_ (self, lookupDict, treeDump, gap, xmlnamespaces, textEncoding,
- stripPrefixes, escape):
- """
- Dumps an XML representation of a trigger.
- """
-
- try:
- asCData = gConfig ('StoreTriggersAsCDATA') == 'True'
-
- except:
- asCData = False
-
- xmlEntity = "trigger"
- xmlString = "%s<%s" % (gap[:-2],xmlEntity)
-
- indent = len(xmlString)
- pos = indent
- for attribute in self.__dict__.keys():
-
- # variables beginning with _ are never saved out to file
- # they are internal to the program
- if attribute[0] == "_":
- continue
-
- val = self.__dict__[attribute]
- if lookupDict[xmlEntity].has_key('Attributes') and \
- lookupDict[xmlEntity]['Attributes'].has_key(attribute):
- if val != None and \
- (not
lookupDict[xmlEntity]['Attributes'][attribute].has_key('Default') or \
- (lookupDict[xmlEntity]['Attributes'][attribute]['Default']) !=
(val)):
- typecast = lookupDict[xmlEntity]['Attributes'][attribute]['Typecast']
- if typecast == GTypecast.boolean \
- and val == 1:
- addl = ' %s=""' % (attribute)
- elif typecast == GTypecast.names:
- addl = ' %s="%s"' % \
- (attribute, string.join(val,','))
- else:
- addl = ' %s="%s"' % (attribute, saxutils.escape('%s' % val))
- if len(addl) + pos > 78:
- xmlString += "\n" + " " * indent + addl
- pos = indent
- else:
- xmlString = xmlString + addl
- pos += len(addl)
-
- if len(self._children):
- hasContent = 0
- for child in self._children:
- hasContent = hasContent or isinstance(child,GContent)
- if hasContent:
- xmlString += ">"
- else:
- xmlString += ">\n"
-
- if treeDump:
- if hasContent and asCData:
- xmlString += "<![CDATA["
- for child in self._children:
- xmlString += child.dumpXML (lookupDict, True , gap + " ",
- xmlnamespaces, textEncoding, stripPrefixes, (not asCData) and
escape)
-
- if hasContent and asCData:
- xmlString += "]]>"
-
- if hasContent:
- xmlString += "</%s>\n" % (xmlEntity)
- else:
- xmlString += "%s</%s>\n" % (gap[:-2], xmlEntity)
- else:
- xmlString += "/>\n"
- return xmlString
-
-
# -----------------------------------------------------------------------------
# Dummy function for non-implemented triggers
# -----------------------------------------------------------------------------
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gnue] r8429 - trunk/gnue-common/src/logic,
reinhard <=