[Python-checkins] python/dist/src/Tools/bgen/bgen bgenBuffer.py, 1.8, 1.9 bgenGenerator.py, 1.15, 1.16 bgenHeapBuffer.py, 1.4, 1.5 bgenModule.py, 1.12, 1.13 bgenObjectDefinition.py, 1.26, 1.27 bgenOutput.py, 1.6, 1.7 bgenStringBuffer.py, 1.2, 1.3 bgenType.py, 1.11, 1.12 macsupport.py, 1.30, 1.31 scantools.py, 1.34, 1.35

tim_one at users.sourceforge.net tim_one at users.sourceforge.net
Sun Jul 18 08:02:36 CEST 2004


Update of /cvsroot/python/python/dist/src/Tools/bgen/bgen
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29862/bgen/bgen

Modified Files:
	bgenBuffer.py bgenGenerator.py bgenHeapBuffer.py bgenModule.py 
	bgenObjectDefinition.py bgenOutput.py bgenStringBuffer.py 
	bgenType.py macsupport.py scantools.py 
Log Message:
Whitespace normalization, via reindent.py.


Index: bgenBuffer.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Tools/bgen/bgen/bgenBuffer.py,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** bgenBuffer.py	19 Jan 2003 21:53:55 -0000	1.8
--- bgenBuffer.py	18 Jul 2004 06:02:01 -0000	1.9
***************
*** 28,32 ****
  
  class FixedInputOutputBufferType(InputOnlyType):
!     
      """Fixed buffer -- passed as (inbuffer, outbuffer)."""
  
--- 28,32 ----
  
  class FixedInputOutputBufferType(InputOnlyType):
! 
      """Fixed buffer -- passed as (inbuffer, outbuffer)."""
  
***************
*** 42,53 ****
          self.declareBuffer(name)
          self.declareSize(name)
!     
      def declareBuffer(self, name):
          self.declareInputBuffer(name)
          self.declareOutputBuffer(name)
!     
      def declareInputBuffer(self, name):
          Output("%s *%s__in__;", self.datatype, name)
!     
      def declareOutputBuffer(self, name):
          Output("%s %s__out__[%s];", self.datatype, name, self.size)
--- 42,53 ----
          self.declareBuffer(name)
          self.declareSize(name)
! 
      def declareBuffer(self, name):
          self.declareInputBuffer(name)
          self.declareOutputBuffer(name)
! 
      def declareInputBuffer(self, name):
          Output("%s *%s__in__;", self.datatype, name)
! 
      def declareOutputBuffer(self, name):
          Output("%s %s__out__[%s];", self.datatype, name, self.size)
***************
*** 62,66 ****
      def getargsArgs(self, name):
          return "&%s__in__, &%s__in_len__" % (name, name)
!     
      def getargsCheck(self, name):
          Output("if (%s__in_len__ != %s)", name, self.size)
--- 62,66 ----
      def getargsArgs(self, name):
          return "&%s__in__, &%s__in_len__" % (name, name)
! 
      def getargsCheck(self, name):
          Output("if (%s__in_len__ != %s)", name, self.size)
***************
*** 72,76 ****
          OutRbrace()
          self.transferSize(name)
!     
      def transferSize(self, name):
          Output("%s__len__ = %s__in_len__;", name, name)
--- 72,76 ----
          OutRbrace()
          self.transferSize(name)
! 
      def transferSize(self, name):
          Output("%s__len__ = %s__in_len__;", name, name)
***************
*** 78,82 ****
      def passOutput(self, name):
          return "%s__in__, %s__out__" % (name, name)
!     
      def mkvalueFormat(self):
          return "s#"
--- 78,82 ----
      def passOutput(self, name):
          return "%s__in__, %s__out__" % (name, name)
! 
      def mkvalueFormat(self):
          return "s#"
***************
*** 84,88 ****
      def mkvalueArgs(self, name):
          return "%s__out__, (int)%s" % (name, self.size)
!     
      def cleanup(self, name):
          if self.label_needed:
--- 84,88 ----
      def mkvalueArgs(self, name):
          return "%s__out__, (int)%s" % (name, self.size)
! 
      def cleanup(self, name):
          if self.label_needed:
***************
*** 93,99 ****
  
  class FixedCombinedInputOutputBufferType(FixedInputOutputBufferType):
!     
      """Like fixed buffer -- but same parameter is input and output."""
!     
      def passOutput(self, name):
          return "(%s *)memcpy(%s__out__, %s__in__, %s)" % \
--- 93,99 ----
  
  class FixedCombinedInputOutputBufferType(FixedInputOutputBufferType):
! 
      """Like fixed buffer -- but same parameter is input and output."""
! 
      def passOutput(self, name):
          return "(%s *)memcpy(%s__out__, %s__in__, %s)" % \
***************
*** 113,120 ****
  
  class OptionalInputBufferMixIn:
!     
      """Add to input buffers if the buffer may be omitted: pass None in Python
      and the C code will get a NULL pointer and zero size"""
!     
      def getargsFormat(self):
          return "z#"
--- 113,120 ----
  
  class OptionalInputBufferMixIn:
! 
      """Add to input buffers if the buffer may be omitted: pass None in Python
      and the C code will get a NULL pointer and zero size"""
! 
      def getargsFormat(self):
          return "z#"
***************
*** 148,208 ****
  
      """Variable size input buffer -- passed as (buffer, size).
!     
      Instantiate without size parameter.
      """
!     
      def __init__(self, datatype = 'char', sizetype = 'int', sizeformat = None):
          FixedInputBufferType.__init__(self, "0", datatype, sizetype, sizeformat)
!     
      def getargsCheck(self, name):
          Output("%s__len__ = %s__in_len__;", name, name)
!     
      def passInput(self, name):
          return "%s__in__, %s__len__" % (name, name)
!         
  class ReverseInputBufferMixin:
      """ Mixin for input buffers that are passed as (size, buffer) """
!     
      def passInput(self, name):
          return "%s__len__, %s__in__" % (name, name)
!         
  class OptionalVarInputBufferType(OptionalInputBufferMixIn, VarInputBufferType):
      pass
!     
  # ----- PART 2: Structure buffers -----
  
  
  class StructInputOutputBufferType(FixedInputOutputBufferType):
!     
      """Structure buffer -- passed as a structure pointer.
  
      Instantiate with the struct type as parameter.
      """
!     
      def __init__(self, type):
          FixedInputOutputBufferType.__init__(self, "sizeof(%s)" % type)
          self.typeName = self.type = type
!     
      def declareInputBuffer(self, name):
          Output("%s *%s__in__;", self.type, name)
!     
      def declareSize(self, name):
          Output("int %s__in_len__;", name)
!     
      def declareOutputBuffer(self, name):
          Output("%s %s__out__;", self.type, name)
!     
      def getargsArgs(self, name):
          return "(char **)&%s__in__, &%s__in_len__" % (name, name)
!     
      def transferSize(self, name):
          pass
!     
      def passInput(self, name):
          return "%s__in__" % name
!     
      def passOutput(self, name):
          return "%s__in__, &%s__out__" % (name, name)
!     
      def mkvalueArgs(self, name):
          return "(char *)&%s__out__, (int)%s" % (name, self.size)
--- 148,208 ----
  
      """Variable size input buffer -- passed as (buffer, size).
! 
      Instantiate without size parameter.
      """
! 
      def __init__(self, datatype = 'char', sizetype = 'int', sizeformat = None):
          FixedInputBufferType.__init__(self, "0", datatype, sizetype, sizeformat)
! 
      def getargsCheck(self, name):
          Output("%s__len__ = %s__in_len__;", name, name)
! 
      def passInput(self, name):
          return "%s__in__, %s__len__" % (name, name)
! 
  class ReverseInputBufferMixin:
      """ Mixin for input buffers that are passed as (size, buffer) """
! 
      def passInput(self, name):
          return "%s__len__, %s__in__" % (name, name)
! 
  class OptionalVarInputBufferType(OptionalInputBufferMixIn, VarInputBufferType):
      pass
! 
  # ----- PART 2: Structure buffers -----
  
  
  class StructInputOutputBufferType(FixedInputOutputBufferType):
! 
      """Structure buffer -- passed as a structure pointer.
  
      Instantiate with the struct type as parameter.
      """
! 
      def __init__(self, type):
          FixedInputOutputBufferType.__init__(self, "sizeof(%s)" % type)
          self.typeName = self.type = type
! 
      def declareInputBuffer(self, name):
          Output("%s *%s__in__;", self.type, name)
! 
      def declareSize(self, name):
          Output("int %s__in_len__;", name)
! 
      def declareOutputBuffer(self, name):
          Output("%s %s__out__;", self.type, name)
! 
      def getargsArgs(self, name):
          return "(char **)&%s__in__, &%s__in_len__" % (name, name)
! 
      def transferSize(self, name):
          pass
! 
      def passInput(self, name):
          return "%s__in__" % name
! 
      def passOutput(self, name):
          return "%s__in__, &%s__out__" % (name, name)
! 
      def mkvalueArgs(self, name):
          return "(char *)&%s__out__, (int)%s" % (name, self.size)
***************
*** 212,216 ****
  
      """Like structure buffer -- but same parameter is input and output."""
!     
      def passOutput(self, name):
          return "(%s *)memcpy((char *)%s__out__, (char *)%s__in__, %s)" % \
--- 212,216 ----
  
      """Like structure buffer -- but same parameter is input and output."""
! 
      def passOutput(self, name):
          return "(%s *)memcpy((char *)%s__out__, (char *)%s__in__, %s)" % \
***************
*** 243,247 ****
      Instantiate with the struct type as parameter.
      """
!     
      def declareSize(self, name):
          pass
--- 243,247 ----
      Instantiate with the struct type as parameter.
      """
! 
      def declareSize(self, name):
          pass
***************
*** 257,261 ****
      Instantiate with the struct type as parameter.
      """
!     
      def declareSize(self, name):
          pass
--- 257,261 ----
      Instantiate with the struct type as parameter.
      """
! 
      def declareSize(self, name):
          pass

Index: bgenGenerator.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Tools/bgen/bgen/bgenGenerator.py,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** bgenGenerator.py	19 Jan 2003 21:53:56 -0000	1.15
--- bgenGenerator.py	18 Jul 2004 06:02:01 -0000	1.16
***************
*** 56,60 ****
          if self.condition:
              Output()
!             Output(self.condition)      
          Output("{\"%s\", (PyCFunction)%s_%s, 1,", name, self.prefix, self.name)
          Output(" PyDoc_STR(%s)},", stringify(docstring))
--- 56,60 ----
          if self.condition:
              Output()
!             Output(self.condition)
          Output("{\"%s\", (PyCFunction)%s_%s, 1,", name, self.prefix, self.name)
          Output(" PyDoc_STR(%s)},", stringify(docstring))
***************
*** 92,96 ****
      def functionbody(self):
          Output("%s", self.body)
!         
      def setselftype(self, selftype, itselftype):
          self.objecttype = selftype
--- 92,96 ----
      def functionbody(self):
          Output("%s", self.body)
! 
      def setselftype(self, selftype, itselftype):
          self.objecttype = selftype
***************
*** 115,119 ****
          else:
              self.rv = None
!     
      def makereturnvar(self):
          return Variable(self.returntype, "_rv", OutMode)
--- 115,119 ----
          else:
              self.rv = None
! 
      def makereturnvar(self):
          return Variable(self.returntype, "_rv", OutMode)
***************
*** 130,134 ****
              arg = Variable(type, name, mode)
              self.argumentList.append(arg)
!     
      def docstring(self):
          input = []
--- 130,134 ----
              arg = Variable(type, name, mode)
              self.argumentList.append(arg)
! 
      def docstring(self):
          input = []
***************
*** 147,151 ****
                      typeName = "?"
                      print "Nameless type", arg.type
!                     
                  str = typeName + ' ' + arg.name
              if arg.mode in (InMode, InOutMode):
--- 147,151 ----
                      typeName = "?"
                      print "Nameless type", arg.type
! 
                  str = typeName + ' ' + arg.name
              if arg.mode in (InMode, InOutMode):
***************
*** 162,166 ****
              outstr = "(%s)" % ", ".join(output)
          return instr + " -> " + outstr
!     
      def functionbody(self):
          self.declarations()
--- 162,166 ----
              outstr = "(%s)" % ", ".join(output)
          return instr + " -> " + outstr
! 
      def functionbody(self):
          self.declarations()
***************
*** 196,200 ****
              if arg.mode in (InMode, InOutMode):
                  arg.getargsCheck()
!     
      def precheck(self):
          pass
--- 196,200 ----
              if arg.mode in (InMode, InOutMode):
                  arg.getargsCheck()
! 
      def precheck(self):
          pass

Index: bgenHeapBuffer.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Tools/bgen/bgen/bgenHeapBuffer.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** bgenHeapBuffer.py	19 Jan 2003 21:53:56 -0000	1.4
--- bgenHeapBuffer.py	18 Jul 2004 06:02:01 -0000	1.5
***************
*** 44,48 ****
  
      """same as base class, but passed as (inbuffer, outbuffer, &size)"""
!     
      def passOutput(self, name):
          return "%s__in__, %s__out__, &%s__len__" % (name, name, name)
--- 44,48 ----
  
      """same as base class, but passed as (inbuffer, outbuffer, &size)"""
! 
      def passOutput(self, name):
          return "%s__in__, %s__out__, &%s__len__" % (name, name, name)
***************
*** 52,56 ****
  
      """same as base class, but passed as (inoutbuffer, size)"""
!     
      def passOutput(self, name):
          return "(%s *)memcpy(%s__out__, %s__in__, %s__len__)" % \
--- 52,56 ----
  
      """same as base class, but passed as (inoutbuffer, size)"""
! 
      def passOutput(self, name):
          return "(%s *)memcpy(%s__out__, %s__in__, %s__len__)" % \
***************
*** 61,65 ****
  
      """same as base class, but passed as (inoutbuffer, &size)"""
!     
      def passOutput(self, name):
          return "(%s *)memcpy(%s__out__, %s__in__, &%s__len__)" % \
--- 61,65 ----
  
      """same as base class, but passed as (inoutbuffer, &size)"""
! 
      def passOutput(self, name):
          return "(%s *)memcpy(%s__out__, %s__in__, &%s__len__)" % \
***************
*** 74,87 ****
      Call from Python with buffer size.
      """
!     
      def declareInputBuffer(self, name):
          pass
!     
      def getargsFormat(self):
          return "i"
!     
      def getargsArgs(self, name):
          return "&%s__in_len__" % name
!     
      def passOutput(self, name):
          return "%s__out__, %s__len__" % (name, name)
--- 74,87 ----
      Call from Python with buffer size.
      """
! 
      def declareInputBuffer(self, name):
          pass
! 
      def getargsFormat(self):
          return "i"
! 
      def getargsArgs(self, name):
          return "&%s__in_len__" % name
! 
      def passOutput(self, name):
          return "%s__out__, %s__len__" % (name, name)

Index: bgenModule.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Tools/bgen/bgen/bgenModule.py,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** bgenModule.py	19 Jan 2003 21:53:56 -0000	1.12
--- bgenModule.py	18 Jul 2004 06:02:01 -0000	1.13
***************
*** 39,43 ****
  
          GeneratorGroup.generate(self)
!         
          if self.finalstuff:
              Output()
--- 39,43 ----
  
          GeneratorGroup.generate(self)
! 
          if self.finalstuff:
              Output()

Index: bgenObjectDefinition.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Tools/bgen/bgen/bgenObjectDefinition.py,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -d -r1.26 -r1.27
*** bgenObjectDefinition.py	15 Jul 2004 21:24:07 -0000	1.26
--- bgenObjectDefinition.py	18 Jul 2004 06:02:01 -0000	1.27
***************
*** 10,21 ****
      def __init__(self, name, prefix, itselftype):
          """ObjectDefinition constructor.  May be extended, but do not override.
!         
          - name: the object's official name, e.g. 'SndChannel'.
          - prefix: the prefix used for the object's functions and data, e.g. 'SndCh'.
          - itselftype: the C type actually contained in the object, e.g. 'SndChannelPtr'.
!         
          XXX For official Python data types, rules for the 'Py' prefix are a problem.
          """
!         
          GeneratorGroup.__init__(self, prefix or name)
          self.name = name
--- 10,21 ----
      def __init__(self, name, prefix, itselftype):
          """ObjectDefinition constructor.  May be extended, but do not override.
! 
          - name: the object's official name, e.g. 'SndChannel'.
          - prefix: the prefix used for the object's functions and data, e.g. 'SndCh'.
          - itselftype: the C type actually contained in the object, e.g. 'SndChannelPtr'.
! 
          XXX For official Python data types, rules for the 'Py' prefix are a problem.
          """
! 
          GeneratorGroup.__init__(self, prefix or name)
          self.name = name
***************
*** 36,40 ****
          # In case we are referenced from a module
          pass
!         
      def setmodulename(self, name):
          self.modulename = name
--- 36,40 ----
          # In case we are referenced from a module
          pass
! 
      def setmodulename(self, name):
          self.modulename = name
***************
*** 59,63 ****
  
          self.outputNew()
!         
          self.outputConvert()
  
--- 59,63 ----
  
          self.outputNew()
! 
          self.outputConvert()
  
***************
*** 72,88 ****
  
          self.outputSetattr()
!         
          self.outputCompare()
!         
          self.outputRepr()
!         
          self.outputHash()
!         
          self.outputPEP253Hooks()
!         
          self.outputTypeObject()
  
          OutHeader2("End object type " + self.name)
!         
      def outputMethodChain(self):
          Output("%sPyMethodChain %s_chain = { %s_methods, %s };",
--- 72,88 ----
  
          self.outputSetattr()
! 
          self.outputCompare()
! 
          self.outputRepr()
! 
          self.outputHash()
! 
          self.outputPEP253Hooks()
! 
          self.outputTypeObject()
  
          OutHeader2("End object type " + self.name)
! 
      def outputMethodChain(self):
          Output("%sPyMethodChain %s_chain = { %s_methods, %s };",
***************
*** 109,116 ****
      def outputInitStructMembers(self):
          Output("it->ob_itself = %sitself;", self.argref)
!     
      def outputCheckNewArg(self):
!             "Override this method to apply additional checks/conversions"
!     
      def outputConvert(self):
          Output("%sint %s_Convert(PyObject *v, %s *p_itself)", self.static, self.prefix,
--- 109,116 ----
      def outputInitStructMembers(self):
          Output("it->ob_itself = %sitself;", self.argref)
! 
      def outputCheckNewArg(self):
!         "Override this method to apply additional checks/conversions"
! 
      def outputConvert(self):
          Output("%sint %s_Convert(PyObject *v, %s *p_itself)", self.static, self.prefix,
***************
*** 207,211 ****
          DedentLevel()
          Output("};")
!         
      def outputTypeObjectInitializer(self):
          Output("""%s.ob_type = &PyType_Type;""", self.typename)
--- 207,211 ----
          DedentLevel()
          Output("};")
! 
      def outputTypeObjectInitializer(self):
          Output("""%s.ob_type = &PyType_Type;""", self.typename)
***************
*** 221,228 ****
      def outputPEP253Hooks(self):
          pass
!         
  class PEP252Mixin:
      getsetlist = []
!     
      def assertions(self):
          # Check that various things aren't overridden. If they are it could
--- 221,228 ----
      def outputPEP253Hooks(self):
          pass
! 
  class PEP252Mixin:
      getsetlist = []
! 
      def assertions(self):
          # Check that various things aren't overridden. If they are it could
***************
*** 233,240 ****
          assert self.outputGetattrHook == None
          assert self.basechain == "NULL"
!         
      def outputGetattr(self):
          pass
!         
      outputGetattrBody = None
  
--- 233,240 ----
          assert self.outputGetattrHook == None
          assert self.basechain == "NULL"
! 
      def outputGetattr(self):
          pass
! 
      outputGetattrBody = None
  
***************
*** 243,251 ****
      def outputSetattr(self):
          pass
!     
      def outputMethodChain(self):
          # This is a good place to output the getters and setters
          self.outputGetSetList()
!     
      def outputHook(self, name):
          methodname = "outputHook_" + name
--- 243,251 ----
      def outputSetattr(self):
          pass
! 
      def outputMethodChain(self):
          # This is a good place to output the getters and setters
          self.outputGetSetList()
! 
      def outputHook(self, name):
          methodname = "outputHook_" + name
***************
*** 255,259 ****
          else:
              Output("0, /*%s*/", name)
!     
      def outputTypeObject(self):
          sf = self.static and "static "
--- 255,259 ----
          else:
              Output("0, /*%s*/", name)
! 
      def outputTypeObject(self):
          sf = self.static and "static "
***************
*** 269,273 ****
          Output("sizeof(%s), /*tp_basicsize*/", self.objecttype)
          Output("0, /*tp_itemsize*/")
!         
          Output("/* methods */")
          Output("(destructor) %s_dealloc, /*tp_dealloc*/", self.prefix)
--- 269,273 ----
          Output("sizeof(%s), /*tp_basicsize*/", self.objecttype)
          Output("0, /*tp_itemsize*/")
! 
          Output("/* methods */")
          Output("(destructor) %s_dealloc, /*tp_dealloc*/", self.prefix)
***************
*** 277,285 ****
          Output("(cmpfunc) %s_compare, /*tp_compare*/", self.prefix)
          Output("(reprfunc) %s_repr, /*tp_repr*/", self.prefix)
!         
          Output("(PyNumberMethods *)0, /* tp_as_number */")
          Output("(PySequenceMethods *)0, /* tp_as_sequence */")
          Output("(PyMappingMethods *)0, /* tp_as_mapping */")
!         
          Output("(hashfunc) %s_hash, /*tp_hash*/", self.prefix)
          self.outputHook("tp_call")
--- 277,285 ----
          Output("(cmpfunc) %s_compare, /*tp_compare*/", self.prefix)
          Output("(reprfunc) %s_repr, /*tp_repr*/", self.prefix)
! 
          Output("(PyNumberMethods *)0, /* tp_as_number */")
          Output("(PySequenceMethods *)0, /* tp_as_sequence */")
          Output("(PyMappingMethods *)0, /* tp_as_mapping */")
! 
          Output("(hashfunc) %s_hash, /*tp_hash*/", self.prefix)
          self.outputHook("tp_call")
***************
*** 287,291 ****
          Output("PyObject_GenericGetAttr, /*tp_getattro*/")
          Output("PyObject_GenericSetAttr, /*tp_setattro */")
!         
          self.outputHook("tp_as_buffer")
          Output("%s, /* tp_flags */", self.tp_flags)
--- 287,291 ----
          Output("PyObject_GenericGetAttr, /*tp_getattro*/")
          Output("PyObject_GenericSetAttr, /*tp_setattro */")
! 
          self.outputHook("tp_as_buffer")
          Output("%s, /* tp_flags */", self.tp_flags)
***************
*** 311,315 ****
          DedentLevel()
          Output("};")
!         
      def outputGetSetList(self):
          if self.getsetlist:
--- 311,315 ----
          DedentLevel()
          Output("};")
! 
      def outputGetSetList(self):
          if self.getsetlist:
***************
*** 325,329 ****
                      Output("#define %s_set_%s NULL", self.prefix, name)
                      Output()
!                     
              Output("static PyGetSetDef %s_getsetlist[] = {", self.prefix)
              IndentLevel()
--- 325,329 ----
                      Output("#define %s_set_%s NULL", self.prefix, name)
                      Output()
! 
              Output("static PyGetSetDef %s_getsetlist[] = {", self.prefix)
              IndentLevel()
***************
*** 333,337 ****
                  else:
                      doc = "NULL"
!                 Output("{\"%s\", (getter)%s_get_%s, (setter)%s_set_%s, %s},", 
                      name, self.prefix, name, self.prefix, name, doc)
              Output("{NULL, NULL, NULL, NULL},")
--- 333,337 ----
                  else:
                      doc = "NULL"
!                 Output("{\"%s\", (getter)%s_get_%s, (setter)%s_set_%s, %s},",
                      name, self.prefix, name, self.prefix, name, doc)
              Output("{NULL, NULL, NULL, NULL},")
***************
*** 341,345 ****
              Output("#define %s_getsetlist NULL", self.prefix)
          Output()
!             
      def outputGetter(self, name, code):
          Output("static PyObject *%s_get_%s(%s *self, void *closure)",
--- 341,345 ----
              Output("#define %s_getsetlist NULL", self.prefix)
          Output()
! 
      def outputGetter(self, name, code):
          Output("static PyObject *%s_get_%s(%s *self, void *closure)",
***************
*** 349,353 ****
          OutRbrace()
          Output()
!         
      def outputSetter(self, name, code):
          Output("static int %s_set_%s(%s *self, PyObject *v, void *closure)",
--- 349,353 ----
          OutRbrace()
          Output()
! 
      def outputSetter(self, name, code):
          Output("static int %s_set_%s(%s *self, PyObject *v, void *closure)",
***************
*** 358,379 ****
          OutRbrace()
          Output()
!         
  class PEP253Mixin(PEP252Mixin):
      tp_flags = "Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE"
!     
      def outputHook_tp_init(self):
          Output("%s_tp_init, /* tp_init */", self.prefix)
!         
      def outputHook_tp_alloc(self):
          Output("%s_tp_alloc, /* tp_alloc */", self.prefix)
!     
      def outputHook_tp_new(self):
          Output("%s_tp_new, /* tp_new */", self.prefix)
!         
      def outputHook_tp_free(self):
          Output("%s_tp_free, /* tp_free */", self.prefix)
!         
      output_tp_initBody = None
!     
      def output_tp_init(self):
          if self.output_tp_initBody:
--- 358,379 ----
          OutRbrace()
          Output()
! 
  class PEP253Mixin(PEP252Mixin):
      tp_flags = "Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE"
! 
      def outputHook_tp_init(self):
          Output("%s_tp_init, /* tp_init */", self.prefix)
! 
      def outputHook_tp_alloc(self):
          Output("%s_tp_alloc, /* tp_alloc */", self.prefix)
! 
      def outputHook_tp_new(self):
          Output("%s_tp_new, /* tp_new */", self.prefix)
! 
      def outputHook_tp_free(self):
          Output("%s_tp_free, /* tp_free */", self.prefix)
! 
      output_tp_initBody = None
! 
      def output_tp_init(self):
          if self.output_tp_initBody:
***************
*** 385,391 ****
              Output("#define %s_tp_init 0", self.prefix)
          Output()
!         
      output_tp_allocBody = None
!     
      def output_tp_alloc(self):
          if self.output_tp_allocBody:
--- 385,391 ----
              Output("#define %s_tp_init 0", self.prefix)
          Output()
! 
      output_tp_allocBody = None
! 
      def output_tp_alloc(self):
          if self.output_tp_allocBody:
***************
*** 398,402 ****
              Output("#define %s_tp_alloc PyType_GenericAlloc", self.prefix)
          Output()
!         
      def output_tp_newBody(self):
          Output("PyObject *self;");
--- 398,402 ----
              Output("#define %s_tp_alloc PyType_GenericAlloc", self.prefix)
          Output()
! 
      def output_tp_newBody(self):
          Output("PyObject *self;");
***************
*** 409,413 ****
          Output("((%s *)self)->ob_itself = itself;", self.objecttype)
          Output("return self;")
!     
      def output_tp_new(self):
          if self.output_tp_newBody:
--- 409,413 ----
          Output("((%s *)self)->ob_itself = itself;", self.objecttype)
          Output("return self;")
! 
      def output_tp_new(self):
          if self.output_tp_newBody:
***************
*** 419,425 ****
              Output("#define %s_tp_new PyType_GenericNew", self.prefix)
          Output()
!     
      output_tp_freeBody = None
!     
      def output_tp_free(self):
          if self.output_tp_freeBody:
--- 419,425 ----
              Output("#define %s_tp_new PyType_GenericNew", self.prefix)
          Output()
! 
      output_tp_freeBody = None
! 
      def output_tp_free(self):
          if self.output_tp_freeBody:
***************
*** 431,435 ****
              Output("#define %s_tp_free PyObject_Del", self.prefix)
          Output()
!         
      def outputPEP253Hooks(self):
          self.output_tp_init()
--- 431,435 ----
              Output("#define %s_tp_free PyObject_Del", self.prefix)
          Output()
! 
      def outputPEP253Hooks(self):
          self.output_tp_init()
***************
*** 440,444 ****
  class GlobalObjectDefinition(ObjectDefinition):
      """Like ObjectDefinition but exports some parts.
!     
      XXX Should also somehow generate a .h file for them.
      """
--- 440,444 ----
  class GlobalObjectDefinition(ObjectDefinition):
      """Like ObjectDefinition but exports some parts.
! 
      XXX Should also somehow generate a .h file for them.
      """
***************
*** 454,458 ****
      the corresponding Python objects. With this you can create Python object
      wrappers on the fly"""
!     
      def outputCompare(self):
          Output()
--- 454,458 ----
      the corresponding Python objects. With this you can create Python object
      wrappers on the fly"""
! 
      def outputCompare(self):
          Output()
***************
*** 476,480 ****
          Output("return 0;")
          OutRbrace()
!         
      def outputHash(self):
          Output()
--- 476,480 ----
          Output("return 0;")
          OutRbrace()
! 
      def outputHash(self):
          Output()
***************
*** 483,486 ****
          Output("return (long)self->ob_itself;")
          OutRbrace()
-         
- 
--- 483,484 ----

Index: bgenOutput.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Tools/bgen/bgen/bgenOutput.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** bgenOutput.py	20 Oct 2003 14:01:55 -0000	1.6
--- bgenOutput.py	18 Jul 2004 06:02:01 -0000	1.7
***************
*** 31,35 ****
  def SetOutputFileName(filename = None):
      """Call this with a filename to make it the output file.
!     
      Call it without arguments to close the current file (if necessary)
      and reset it to sys.stdout.
--- 31,35 ----
  def SetOutputFileName(filename = None):
      """Call this with a filename to make it the output file.
! 
      Call it without arguments to close the current file (if necessary)
      and reset it to sys.stdout.
***************
*** 96,100 ****
  def OutIndent(format = "", *args):
      """Combine Output() followed by IndentLevel().
!     
      If no text is given, acts like lone IndentLevel().
      """
--- 96,100 ----
  def OutIndent(format = "", *args):
      """Combine Output() followed by IndentLevel().
! 
      If no text is given, acts like lone IndentLevel().
      """
***************
*** 104,108 ****
  def OutDedent(format = "", *args):
      """Combine Output() followed by DedentLevel().
!     
      If no text is given, acts like loneDedentLevel().
      """
--- 104,108 ----
  def OutDedent(format = "", *args):
      """Combine Output() followed by DedentLevel().
! 
      If no text is given, acts like loneDedentLevel().
      """
***************
*** 112,116 ****
  def OutLbrace(format = "", *args):
      """Like Output, but add a '{' and increase the indentation level.
!     
      If no text is given a lone '{' is output.
      """
--- 112,116 ----
  def OutLbrace(format = "", *args):
      """Like Output, but add a '{' and increase the indentation level.
! 
      If no text is given a lone '{' is output.
      """
***************
*** 144,148 ****
  def Out(text):
      """Output multiline text that's internally indented.
!     
      Pass this a multiline character string.  The whitespace before the
      first nonblank line of the string will be subtracted from all lines.
--- 144,148 ----
  def Out(text):
      """Output multiline text that's internally indented.
! 
      Pass this a multiline character string.  The whitespace before the
      first nonblank line of the string will be subtracted from all lines.
***************
*** 150,154 ****
      of formatting (if you need formatting you can do it before the call).
      Recommended use:
!     
          Out('''
              int main(argc, argv)
--- 150,154 ----
      of formatting (if you need formatting you can do it before the call).
      Recommended use:
! 
          Out('''
              int main(argc, argv)
***************
*** 160,164 ****
              }
          ''')
!     
      Caveat: the indentation must be consistent -- if you use three tabs
      in the first line, (up to) three tabs are removed from following lines,
--- 160,164 ----
              }
          ''')
! 
      Caveat: the indentation must be consistent -- if you use three tabs
      in the first line, (up to) three tabs are removed from following lines,
***************
*** 167,171 ****
      """
      # (Don't you love using triple quotes *inside* triple quotes? :-)
!     
      lines = text.split('\n')
      indent = ""
--- 167,171 ----
      """
      # (Don't you love using triple quotes *inside* triple quotes? :-)
! 
      lines = text.split('\n')
      indent = ""
***************
*** 194,198 ****
          #include <Python.h>
          #include <stdio.h>
!     
          main(argc, argv)
              int argc;
--- 194,198 ----
          #include <Python.h>
          #include <stdio.h>
! 
          main(argc, argv)
              int argc;

Index: bgenStringBuffer.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Tools/bgen/bgen/bgenStringBuffer.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** bgenStringBuffer.py	19 Jan 2003 21:53:57 -0000	1.2
--- bgenStringBuffer.py	18 Jul 2004 06:02:01 -0000	1.3
***************
*** 23,33 ****
      less common.  I'll write the classes when there is demand.)
      """
!     
      def declareSize(self, name):
          pass
!     
      def getargsFormat(self):
          return "s"
!     
      def getargsArgs(self, name):
          return "&%s__in__" % name
--- 23,33 ----
      less common.  I'll write the classes when there is demand.)
      """
! 
      def declareSize(self, name):
          pass
! 
      def getargsFormat(self):
          return "s"
! 
      def getargsArgs(self, name):
          return "&%s__in__" % name

Index: bgenType.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Tools/bgen/bgen/bgenType.py,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** bgenType.py	24 Jan 2003 09:23:13 -0000	1.11
--- bgenType.py	18 Jul 2004 06:02:01 -0000	1.12
***************
*** 205,210 ****
          else:
              # Three arguments (name, new, convert)
!             self.new = arg 
!             self.convert = extra 
  
      def getargsFormat(self):
--- 205,210 ----
          else:
              # Three arguments (name, new, convert)
!             self.new = arg
!             self.convert = extra
  
      def getargsFormat(self):
***************
*** 237,241 ****
      def mkvalueArgs(self, name):
          return "%s, %s" % (self.new, name)
!         
  class OpaqueByValueStructType(OpaqueByValueType):
      """Similar to OpaqueByValueType, but we also pass this to mkvalue by
--- 237,241 ----
      def mkvalueArgs(self, name):
          return "%s, %s" % (self.new, name)
! 
  class OpaqueByValueStructType(OpaqueByValueType):
      """Similar to OpaqueByValueType, but we also pass this to mkvalue by

Index: macsupport.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Tools/bgen/bgen/macsupport.py,v
retrieving revision 1.30
retrieving revision 1.31
diff -C2 -d -r1.30 -r1.31
*** macsupport.py	20 Nov 2003 13:31:00 -0000	1.30
--- macsupport.py	18 Jul 2004 06:02:01 -0000	1.31
***************
*** 130,137 ****
      def getargsFormat(self):
          return "u#"
!         
  class VarUnicodeReverseInputBufferType(ReverseInputBufferMixin, VarUnicodeInputBufferType):
      pass
!     
  UnicodeInBuffer = VarUnicodeInputBufferType('UniChar', 'UniCharCount', 'l')
  UnicodeReverseInBuffer = VarUnicodeReverseInputBufferType('UniChar', 'UniCharCount', 'l')
--- 130,137 ----
      def getargsFormat(self):
          return "u#"
! 
  class VarUnicodeReverseInputBufferType(ReverseInputBufferMixin, VarUnicodeInputBufferType):
      pass
! 
  UnicodeInBuffer = VarUnicodeInputBufferType('UniChar', 'UniCharCount', 'l')
  UnicodeReverseInBuffer = VarUnicodeReverseInputBufferType('UniChar', 'UniCharCount', 'l')
***************
*** 181,185 ****
  class WeakLinkMixIn:
      "Mix-in to test the function actually exists (!= NULL) before calling"
!     
      def precheck(self):
          Output('#ifndef %s', self.name)
--- 181,185 ----
  class WeakLinkMixIn:
      "Mix-in to test the function actually exists (!= NULL) before calling"
! 
      def precheck(self):
          Output('#ifndef %s', self.name)

Index: scantools.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Tools/bgen/bgen/scantools.py,v
retrieving revision 1.34
retrieving revision 1.35
diff -C2 -d -r1.34 -r1.35
*** scantools.py	12 Feb 2004 17:35:14 -0000	1.34
--- scantools.py	18 Jul 2004 06:02:01 -0000	1.35
***************
*** 52,64 ****
          if input:
              self.setinput(input)
!     
      def initusedtypes(self):
          self.usedtypes = {}
!     
      def typeused(self, type, mode):
          if not self.usedtypes.has_key(type):
              self.usedtypes[type] = {}
          self.usedtypes[type][mode] = None
!     
      def reportusedtypes(self):
          types = self.usedtypes.keys()
--- 52,64 ----
          if input:
              self.setinput(input)
! 
      def initusedtypes(self):
          self.usedtypes = {}
! 
      def typeused(self, type, mode):
          if not self.usedtypes.has_key(type):
              self.usedtypes[type] = {}
          self.usedtypes[type][mode] = None
! 
      def reportusedtypes(self):
          types = self.usedtypes.keys()
***************
*** 101,110 ****
      def writeinitialdefs(self):
          pass
!         
      def initblacklists(self):
          self.blacklistnames = self.makeblacklistnames()
          self.blacklisttypes = ["unknown", "-"] + self.makeblacklisttypes()
          self.greydictnames = self.greylist2dict(self.makegreylist())
!         
      def greylist2dict(self, list):
          rv = {}
--- 101,110 ----
      def writeinitialdefs(self):
          pass
! 
      def initblacklists(self):
          self.blacklistnames = self.makeblacklistnames()
          self.blacklisttypes = ["unknown", "-"] + self.makeblacklisttypes()
          self.greydictnames = self.greylist2dict(self.makegreylist())
! 
      def greylist2dict(self, list):
          rv = {}
***************
*** 119,123 ****
      def makeblacklisttypes(self):
          return []
!         
      def makegreylist(self):
          return []
--- 119,123 ----
      def makeblacklisttypes(self):
          return []
! 
      def makegreylist(self):
          return []
***************
*** 129,133 ****
      def makerepairinstructions(self):
          """Parse the repair file into repair instructions.
!         
          The file format is simple:
          1) use \ to split a long logical line in multiple physical lines
--- 129,133 ----
      def makerepairinstructions(self):
          """Parse the repair file into repair instructions.
! 
          The file format is simple:
          1) use \ to split a long logical line in multiple physical lines
***************
*** 217,224 ****
              list.append((fpat, patterns, replacements))
          return list
!         
      def makeinherentpointertypes(self):
          return []
!     
      def openrepairfile(self, filename = "REPAIR"):
          try:
--- 217,224 ----
              list.append((fpat, patterns, replacements))
          return list
! 
      def makeinherentpointertypes(self):
          return []
! 
      def openrepairfile(self, filename = "REPAIR"):
          try:
***************
*** 338,342 ****
          self.allscaninputs = scan
          self._nextinput()
!         
      def _nextinput(self):
          if not self.allscaninputs:
--- 338,342 ----
          self.allscaninputs = scan
          self._nextinput()
! 
      def _nextinput(self):
          if not self.allscaninputs:
***************
*** 527,531 ****
          type = re.sub("[ \t]+", "_", type)
          return self.modifyarg(type, name, mode)
!     
      def modifyarg(self, type, name, mode):
          if type[:6] == "const_":
--- 527,531 ----
          type = re.sub("[ \t]+", "_", type)
          return self.modifyarg(type, name, mode)
! 
      def modifyarg(self, type, name, mode):
          if type[:6] == "const_":
***************
*** 568,572 ****
                  i = i+1
          return arglist
!     
      def matcharg(self, patarg, arg):
          return len(filter(None, map(fnmatch.fnmatchcase, arg, patarg))) == 3
--- 568,572 ----
                  i = i+1
          return arglist
! 
      def matcharg(self, patarg, arg):
          return len(filter(None, map(fnmatch.fnmatchcase, arg, patarg))) == 3
***************
*** 667,669 ****
  if __name__ == '__main__':
      test()
- 
--- 667,668 ----



More information about the Python-checkins mailing list