[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnue] r8079 - in trunk: gnue-common/src/definitions gnue-designer/src/b
From: |
btami |
Subject: |
[gnue] r8079 - in trunk: gnue-common/src/definitions gnue-designer/src/base gnue-designer/src/reports gnue-reports/src/adapters/filters/Char/char gnue-reports/src/base/layout |
Date: |
Tue, 25 Oct 2005 17:23:06 -0500 (CDT) |
Author: btami
Date: 2005-10-25 17:23:05 -0500 (Tue, 25 Oct 2005)
New Revision: 8079
Modified:
trunk/gnue-common/src/definitions/GObjects.py
trunk/gnue-common/src/definitions/GParser.py
trunk/gnue-common/src/definitions/GRootObj.py
trunk/gnue-designer/src/base/Instance.py
trunk/gnue-designer/src/reports/Incubator.py
trunk/gnue-reports/src/adapters/filters/Char/char/CHParser.py
trunk/gnue-reports/src/adapters/filters/Char/char/CHReport.py
trunk/gnue-reports/src/base/layout/GRPassThru.py
Log:
fixed report save bug in designer if report layout defines hes objects (like
Char)
Modified: trunk/gnue-common/src/definitions/GObjects.py
===================================================================
--- trunk/gnue-common/src/definitions/GObjects.py 2005-10-24 20:54:09 UTC
(rev 8078)
+++ trunk/gnue-common/src/definitions/GObjects.py 2005-10-25 22:23:05 UTC
(rev 8079)
@@ -256,8 +256,10 @@
"""
xmlns = ""
xmlnsdef = ""
+
if textEncoding=='<locale>':
textEncoding=gConfig('textEncoding')
+
try:
if self._xmlnamespace:
try:
@@ -285,7 +287,6 @@
except AttributeError:
pass
-
try:
if self._xmlchildnamespaces:
for abbrev in self._xmlchildnamespaces.keys():
@@ -310,6 +311,7 @@
# skip keys beginning with _
if attribute[0] == "_":
continue
+
val = self.__dict__[attribute]
if (xmlns and attribute in self._listedAttributes) or \
(not xmlns and lookupDict[xmlEntity].has_key('Attributes') and \
@@ -317,10 +319,12 @@
if val != None and \
(xmlns or (not
lookupDict[xmlEntity]['Attributes'][attribute].has_key('Default') or \
(lookupDict[xmlEntity]['Attributes'][attribute]['Default']) !=
(val))):
+
try:
typecast =
lookupDict[xmlEntity]['Attributes'][attribute]['Typecast']
except:
typecast = GTypecast.text
+
if typecast == GTypecast.boolean:
if val:
addl = ' %s="Y"' % (attribute)
@@ -338,12 +342,14 @@
addl = ' %s="%s"' % (attribute, saxutils.escape('%s' %
unicode(val, textEncoding)))
else:
addl = ' %s="%s"' % (attribute, saxutils.escape('%s' % val))
+
if len(addl) + pos > 78:
xmlString += "\n" + " " * indent + addl
pos = indent
else:
xmlString += addl
pos += len(addl)
+
if attribute.find('__') > 0 and attribute.split('__')[0] in
xmlnamespaces.keys():
if val != None:
if type(val) == types.StringType:
@@ -382,6 +388,7 @@
xmlString += "%s</%s%s>\n" % (gap[:-2], xmlns, xmlEntity)
else:
xmlString += "/>\n"
+
return xmlString
Modified: trunk/gnue-common/src/definitions/GParser.py
===================================================================
--- trunk/gnue-common/src/definitions/GParser.py 2005-10-24 20:54:09 UTC
(rev 8078)
+++ trunk/gnue-common/src/definitions/GParser.py 2005-10-25 22:23:05 UTC
(rev 8079)
@@ -155,7 +155,7 @@
'got' : object._type}
raise MarkupError, (tmsg, url)
- object.rootComments = dh.getRootComments()
+ object._rootComments = dh.getRootComments()
dh.finalValidation ()
@@ -247,7 +247,7 @@
self._singleInstanceTags = []
self._tagCounts = {}
self.url = None
- self.rootComments = []
+ self._rootComments = []
self.doImportLayoutParser = True
#
@@ -342,6 +342,8 @@
attrs[prefix + '__' + attr] = saxattrs[qattr]
xmlns[prefix] = attrns
+ loadedxmlattrs[attr] = saxattrs[qattr]
+
else:
# Typecasting, anyone? If attribute should be int, make it an int
@@ -420,7 +422,8 @@
object._xmltag = name
object._xmlnamespace = ns
-
+ object._listedAttributes = loadedxmlattrs.keys()
+
elif self.xmlMasqueradeNamespaceElements:
#
# namespace qualifier and we are masquerading
@@ -536,7 +539,7 @@
# lexical handler stuff
def comment(self, text):
if self.root is None:
- self.rootComments.append(text)
+ self._rootComments.append(text)
else:
if self.xmlStack[0] != None:
GComment(self.xmlStack[0], text)
@@ -560,7 +563,7 @@
pass
def getRootComments(self):
- return self.rootComments
+ return self._rootComments
class GImportItem(GObj):
Modified: trunk/gnue-common/src/definitions/GRootObj.py
===================================================================
--- trunk/gnue-common/src/definitions/GRootObj.py 2005-10-24 20:54:09 UTC
(rev 8078)
+++ trunk/gnue-common/src/definitions/GRootObj.py 2005-10-25 22:23:05 UTC
(rev 8079)
@@ -45,7 +45,7 @@
self._xmlParser = xmlParser
self._xmlnamespaces = {}
self._standardnamespaces = {}
- self.rootComments = []
+ self._rootComments = []
# This will store any "global myVar" that the triggers execute.
self._globalRuntimeNamespace = {}
@@ -53,10 +53,13 @@
def initTriggerSystem(self):
self._triggerNamespaceTree = GObjNamespace(self,rootName=self._rname)
- def dumpXML(self, treeDump=1, gap=" ", stripPrefixes=None):
- return GObj.dumpXML(self, self.__xmlElementCallback(),
- treeDump, gap, xmlnamespaces=self._standardnamespaces,
- stripPrefixes=stripPrefixes)
+ def dumpXML(self, lookupDict={}, treeDump=1, gap=" ", xmlnamespaces={},\
+ textEncoding='<locale>', stripPrefixes=None):
+ xmlElements = lookupDict
+ xmlElements.update(self.__xmlElementCallback())
+ return GObj.dumpXML(self, xmlElements, \
+ treeDump, gap, xmlnamespaces=self._standardnamespaces, \
+ textEncoding=textEncoding, stripPrefixes=stripPrefixes)
Modified: trunk/gnue-designer/src/base/Instance.py
===================================================================
--- trunk/gnue-designer/src/base/Instance.py 2005-10-24 20:54:09 UTC (rev
8078)
+++ trunk/gnue-designer/src/base/Instance.py 2005-10-25 22:23:05 UTC (rev
8079)
@@ -524,16 +524,16 @@
fileHandle.write('<?xml version="1.0" encoding="%s"?>\n\n' % \
gConfig('textEncoding'))
- for comment in self.rootObject.rootComments:
+ for comment in self.rootObject._rootComments:
if comment.find(TITLE) > 0:
- self.rootObject.rootComments.remove(comment)
+ self.rootObject._rootComments.remove(comment)
fileHandle.write('<!-- %s (%s)\n%s Saved on: %s -->\n\n' \
% (TITLE, VERSION, (len(self.wizardName) and (" Created by " +
self.wizardName + "\n") or ""),\
time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(time.time()))))
fileHandle.write(''.join(["<!--%s-->\n\n" %
comment.encode(gConfig('textEncoding')) \
- for comment in self.rootObject.rootComments]))
+ for comment in self.rootObject._rootComments]))
fileHandle.write(self.rootObject.dumpXML(treeDump=True).encode(gConfig('textEncoding')))
fileHandle.close()
Modified: trunk/gnue-designer/src/reports/Incubator.py
===================================================================
--- trunk/gnue-designer/src/reports/Incubator.py 2005-10-24 20:54:09 UTC
(rev 8078)
+++ trunk/gnue-designer/src/reports/Incubator.py 2005-10-25 22:23:05 UTC
(rev 8079)
@@ -39,7 +39,7 @@
def createObject(self, rootObject, tag, parent, attributes={}, select=1):
# Handle GRPassThru
- if 0: #tag.find(':')+1:
+ if tag.find(':')+1:
o = self._handlePassThru(rootObject, tag, parent, attributes, select)
if o:
self.instance.dispatchEvent('ObjectCreated',object=o,
originator=__name__)
Modified: trunk/gnue-reports/src/adapters/filters/Char/char/CHParser.py
===================================================================
--- trunk/gnue-reports/src/adapters/filters/Char/char/CHParser.py
2005-10-24 20:54:09 UTC (rev 8078)
+++ trunk/gnue-reports/src/adapters/filters/Char/char/CHParser.py
2005-10-25 22:23:05 UTC (rev 8079)
@@ -54,7 +54,7 @@
#######################################################
def loadFile(buffer, connections=None, initialize=0):
- return GParser.loadXMLObject (buffer, xmlReportHandler, 'CHReport',
'chreport',
+ return GParser.loadXMLObject (buffer, xmlReportHandler, 'CHchReport',
'chreport',
initialize, attributes={})
@@ -75,7 +75,7 @@
#
xmlElements = {
'chreport': {
- 'BaseClass': CHReport.CHReport,
+ 'BaseClass': CHReport.CHchReport,
'Required': 1,
'SingleInstance': 1,
'Attributes': {
Modified: trunk/gnue-reports/src/adapters/filters/Char/char/CHReport.py
===================================================================
--- trunk/gnue-reports/src/adapters/filters/Char/char/CHReport.py
2005-10-24 20:54:09 UTC (rev 8078)
+++ trunk/gnue-reports/src/adapters/filters/Char/char/CHReport.py
2005-10-25 22:23:05 UTC (rev 8079)
@@ -36,10 +36,10 @@
import CHParser
-class CHReport(GRootObj, GRPassThru):
+class CHchReport(GRootObj, GRPassThru):
def __init__(self, parent=None):
GRootObj.__init__(self, 'chreport', CHParser.getXMLelements, CHParser)
- GRPassThru.__init__(self, parent, type='CHReport')
+ GRPassThru.__init__(self, parent, type='CHchReport')
def chProcess(self, writer):
Modified: trunk/gnue-reports/src/base/layout/GRPassThru.py
===================================================================
--- trunk/gnue-reports/src/base/layout/GRPassThru.py 2005-10-24 20:54:09 UTC
(rev 8078)
+++ trunk/gnue-reports/src/base/layout/GRPassThru.py 2005-10-25 22:23:05 UTC
(rev 8079)
@@ -56,6 +56,6 @@
return nextSection
- def getXmlTag(self):
+ def getXmlTag(self, stripPrefixes=None):
return self._xmltag
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gnue] r8079 - in trunk: gnue-common/src/definitions gnue-designer/src/base gnue-designer/src/reports gnue-reports/src/adapters/filters/Char/char gnue-reports/src/base/layout,
btami <=