I've made a few fixes. Here is the note from the README:
Version 1.14e (09/18/2008)
* Minor fix for generation of syntax error (missing parenthesis).
* Eliminated generation of specification of superclass
(superclass =) for undefined types.
* Fixed error setting value in SimpleElementDict.
I've attached a patch file generated against version 1.14d.
I'll upload a new version in a day or two unless someone alerts me to a problem
with these fixes.
- Dave
--
Dave Kuhlman
http://www.rexx.com/~dkuhlman
--- Orig/generateDS-1.14d/generateDS.py 2008-08-14 15:45:07.000000000 -0700
+++ generateDS.py 2008-09-17 16:29:33.000000000 -0700
@@ -75,8 +75,8 @@
import StringIO
# Default logger configuration
-#logging.basicConfig(level=logging.DEBUG,
-# format='%(asctime)s %(levelname)s %(message)s')
+## logging.basicConfig(level=logging.DEBUG,
+## format='%(asctime)s %(levelname)s %(message)s')
##from IPython.Shell import IPShellEmbed
##args = ''
@@ -600,7 +600,7 @@
self.attrs['type'] = type_val
self.type = type_val
if not self.complex:
- SimpleElementDict[self.name] = self.name
+ SimpleElementDict[self.name] = self
for child in self.children:
child.annotate_find_type()
@@ -1079,7 +1079,7 @@
self.inSchema = 0
if len(self.stack) != 1:
print '*** error stack. len(self.stack): %d' % len(self.stack)
- sys.exit(-1)
+ sys.exit(1)
logging.debug("Previous root:", self.root)
self.root = self.stack[0]
logging.debug("New root:", self.root)
@@ -1185,7 +1185,7 @@
child.getType() == NonNegativeIntegerType:
s1 = '%s showIndent(outfile, level)\n' % fill
outfile.write(s1)
- s1 = "%s outfile.write('<%%s%s>%%d</%%s%s>\\n' %% (namespace_, %s_, namespace_)\n" % \
+ s1 = "%s outfile.write('<%%s%s>%%d</%%s%s>\\n' %% (namespace_, %s_, namespace_))\n" % \
(fill, name, name, cleanName, )
outfile.write(s1)
elif child.getType() == BooleanType:
@@ -2668,10 +2668,13 @@
if UserMethodsModule:
generateMemberSpec(outfile, element)
wrt(' subclass = None\n')
- if base:
- wrt(' superclass = %s\n' % (base))
- else:
- wrt(' superclass = None\n')
+ superclass_name = 'None'
+ if base and base in ElementDict:
+ parent = ElementDict[base]
+ parentName = parent.getName()
+ if parentName in AlreadyGenerated:
+ superclass_name = base
+ wrt(' superclass = %s\n' % superclass_name)
generateCtor(outfile, element)
wrt(' def factory(*args_, **kwargs_):\n')
wrt(' if %s%s.subclass:\n' % (prefix, name))
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
generateds-users mailing list
generateds-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/generateds-users