(self)
return "\n".join(lines)
Generates a ctypes.Union declaration for self.
Generates a ctypes.Union declaration for self.
Generates a ctypes . Union declaration for self .
def ctypes_decl(self):
    """Generates a ctypes.Union declaration for self."""
    indent = codegen_util.Indenter()
    lines = []
    lines.append(textwrap.dedent("""
    class {0.ctypes_typename}(ctypes.Union):
      \"\"\"{0.docstring}\"\"\"""".format(self)))
    with indent:
      if self.members:
        lines.append(indent("_fields_ = ["))
        with indent:
          with indent:
            for member in self.members.values():
              lines.append(indent(member.ctypes_field_decl + ","))
        lines.append(indent("]\n"))
    return "\n".join(lines)
def ctypes_decl ( self ) : indent = codegen_util . Indenter ( ) lines = [ ] lines . append ( textwrap . dedent ( """
    class {0.ctypes_typename}(ctypes.Union):
      \"\"\"{0.docstring}\"\"\"""" . format ( self ) ) ) with indent : if self . members : lines . append ( indent ( "_fields_ = [" ) ) with indent : with indent : for member in self . members . values ( ) : lines . append ( indent ( member . ctypes_field_decl + "," ) ) lines . append ( indent ( "]\n" ) ) return "\n" . join ( lines )