From 9403591014c5904baef0ad4d808cf222b107dc1f Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Mon, 27 Aug 2001 14:30:55 +0000 Subject: Fixes by Thomas Heller: - make the selftests work again (they were apparently not used since very early in bgen's development), with some minor cleanup by me - make emacs python mode happier --- Tools/bgen/bgen/bgenGenerator.py | 12 ++++++------ Tools/bgen/bgen/bgenGeneratorGroup.py | 5 +++-- Tools/bgen/bgen/bgenModule.py | 4 ++-- Tools/bgen/bgen/bgenObjectDefinition.py | 2 +- Tools/bgen/bgen/bgenOutput.py | 2 +- 5 files changed, 13 insertions(+), 12 deletions(-) diff --git a/Tools/bgen/bgen/bgenGenerator.py b/Tools/bgen/bgen/bgenGenerator.py index 47fed8e..1a35c12 100644 --- a/Tools/bgen/bgen/bgenGenerator.py +++ b/Tools/bgen/bgen/bgenGenerator.py @@ -259,12 +259,12 @@ class MethodGenerator(FunctionGenerator): def _test(): void = None - eggs = Generator(void, "eggs", - Variable(stringptr, 'cmd'), - Variable(int, 'x'), - Variable(double, 'y', InOutMode), - Variable(int, 'status', ErrorMode), - ) + eggs = FunctionGenerator(void, "eggs", + (stringptr, 'cmd', InMode), + (int, 'x', InMode), + (double, 'y', InOutMode), + (int, 'status', ErrorMode), + ) eggs.setprefix("spam") print "/* START */" eggs.generate() diff --git a/Tools/bgen/bgen/bgenGeneratorGroup.py b/Tools/bgen/bgen/bgenGeneratorGroup.py index 5a62905..784bf69 100644 --- a/Tools/bgen/bgen/bgenGeneratorGroup.py +++ b/Tools/bgen/bgen/bgenGeneratorGroup.py @@ -28,9 +28,10 @@ class GeneratorGroup: def _test(): - from bgenGenerator import Generator + void = None + from bgenGenerator import FunctionGenerator group = GeneratorGroup("spam") - eggs = Generator(void, "eggs") + eggs = FunctionGenerator(void, "eggs") group.add(eggs) print "/* START */" group.generate() diff --git a/Tools/bgen/bgen/bgenModule.py b/Tools/bgen/bgen/bgenModule.py index b4a3db0..5f94b904 100644 --- a/Tools/bgen/bgen/bgenModule.py +++ b/Tools/bgen/bgen/bgenModule.py @@ -78,9 +78,9 @@ class Module(GeneratorGroup): def _test(): - from bgenGenerator import Generator + from bgenGenerator import FunctionGenerator m = Module("spam", "", "#include ") - g = Generator(None, "bacon") + g = FunctionGenerator(None, "bacon") m.add(g) m.generate() diff --git a/Tools/bgen/bgen/bgenObjectDefinition.py b/Tools/bgen/bgen/bgenObjectDefinition.py index e6db9cd..2186e0e 100644 --- a/Tools/bgen/bgen/bgenObjectDefinition.py +++ b/Tools/bgen/bgen/bgenObjectDefinition.py @@ -189,7 +189,7 @@ class ObjectDefinition(GeneratorGroup): Output("""if (PyDict_SetItemString(d, "%sType", (PyObject *)&%s) != 0)""", self.name, self.typename); IndentLevel() - Output("""Py_FatalError("can't initialize %sType");""", + Output("""Py_FatalError("can\'t initialize %sType");""", self.name) DedentLevel() diff --git a/Tools/bgen/bgen/bgenOutput.py b/Tools/bgen/bgen/bgenOutput.py index 1a512e5..a269585 100644 --- a/Tools/bgen/bgen/bgenOutput.py +++ b/Tools/bgen/bgen/bgenOutput.py @@ -43,7 +43,7 @@ SetOutputFile() # Initialize _File _Level = 0 # Indentation level def GetLevel(): - """"Return the current indentation level.""" + """Return the current indentation level.""" return _Level def SetLevel(level): -- cgit v0.12