Lines Matching refs:write
455 include.write("#if %s\n" % cond)
456 export.write("#if %s\n" % cond)
457 output.write("#if %s\n" % cond)
459 include.write("PyObject * ")
460 include.write("libxml_%s(PyObject *self, PyObject *args);\n" % (name))
462 export.write(" { (char *)\"%s\", libxml_%s, METH_VARARGS, NULL },\n" %
468 include.write("#endif\n")
469 export.write("#endif\n")
470 output.write("#endif\n")
475 include.write("#endif\n")
476 export.write("#endif\n")
477 output.write("#endif\n")
480 output.write("PyObject *\n")
481 output.write("libxml_%s(PyObject *self ATTRIBUTE_UNUSED," % (name))
482 output.write(" PyObject *args")
484 output.write(" ATTRIBUTE_UNUSED")
485 output.write(") {\n")
487 output.write(" PyObject *py_retval;\n")
489 output.write(c_return)
491 output.write(c_args)
493 output.write("\n if (!PyArg_ParseTuple(args, (char *)\"%s\"%s))\n" %
495 output.write(" return(NULL);\n")
497 output.write(c_convert)
499 output.write(c_call)
501 output.write(c_release)
502 output.write(ret_convert)
503 output.write("}\n\n")
505 include.write("#endif /* %s */\n" % cond)
506 export.write("#endif /* %s */\n" % cond)
507 output.write("#endif /* %s */\n" % cond)
553 include.write("/* Generated */\n\n")
555 export.write("/* Generated */\n\n")
557 wrapper.write("/* Generated */\n\n")
558 wrapper.write("#include <Python.h>\n")
559 wrapper.write("#include <libxml/xmlversion.h>\n")
560 wrapper.write("#include <libxml/tree.h>\n")
561 wrapper.write("#include <libxml/xmlschemastypes.h>\n")
562 wrapper.write("#include \"libxml_wrap.h\"\n")
563 wrapper.write("#include \"libxml2-py.h\"\n\n")
829 output.write(indent)
830 output.write('"""')
841 output.write(str)
842 output.write('\n ')
843 output.write(indent)
844 output.write(val)
845 output.write(' """\n')
938 txt.write(" Generated Classes for libxml2-python\n\n")
940 txt.write("#\n# Global functions of the module\n#\n\n")
948 classes.write("#\n# Functions from module %s\n#\n\n" % file)
949 txt.write("\n# functions from module %s\n" % file)
951 classes.write("def %s(" % func)
952 txt.write("%s()\n" % func)
956 classes.write(", ")
957 classes.write("%s" % arg[0])
959 classes.write("):\n")
964 classes.write(" if %s is None: %s__o = None\n" %
966 classes.write(" else: %s__o = %s%s\n" %
971 classes.write(" if %s is not None: %s.flush()\n" % (
975 classes.write(" ret = ")
977 classes.write(" ")
978 classes.write("libxml2mod.%s(" % name)
982 classes.write(", ")
983 classes.write("%s" % arg[0])
985 classes.write("__o")
987 classes.write(")\n")
1004 classes.write(" if ret is None:return None\n")
1006 classes.write(
1010 classes.write(
1014 classes.write(
1018 classes.write(
1021 classes.write(" return ")
1022 classes.write(classes_type[ret[0]][1] % ("ret"))
1023 classes.write("\n")
1025 classes.write(" return ret\n")
1026 classes.write("\n")
1028 txt.write("\n\n#\n# Set of classes of the module\n#\n\n")
1034 txt.write("\n\nClass %s(%s)\n" % (classname,
1036 classes.write("class %s(%s):\n" % (classname,
1038 classes.write(" def __init__(self, _obj=None):\n")
1041 classes.write(" if checkWrapper(_obj) != 0:")
1042 classes.write(" raise TypeError")
1043 classes.write("('%s got a wrong wrapper object type')\n" % \
1048 classes.write(" self.%s = None\n" % ref[1])
1049 classes.write(" self._o = _obj\n")
1050 classes.write(" %s.__init__(self, _obj=_obj)\n\n" % (
1054 classes.write(" def __repr__(self):\n")
1056 classes.write(" return \"%s\" %% (self.name, int(pos_id (self)))\n\n" % (
1059 txt.write("Class %s()\n" % (classname))
1060 classes.write("class %s:\n" % (classname))
1061 classes.write(" def __init__(self, _obj=None):\n")
1065 classes.write(" self.%s = None\n" % ref[1])
1066 classes.write(" if _obj != None:self._o = _obj;return\n")
1067 classes.write(" self._o = None\n\n")
1070 classes.write(" def __del__(self):\n")
1071 classes.write(" if self._o != None:\n")
1072 classes.write(" libxml2mod.%s(self._o)\n" %
1074 classes.write(" self._o = None\n\n")
1089 classes.write(" # accessors for %s\n" % (classname))
1090 txt.write(" # accessors\n")
1092 classes.write(" #\n")
1093 classes.write(" # %s functions from module %s\n" % (
1095 txt.write("\n # functions from module %s\n" % file)
1096 classes.write(" #\n\n")
1098 classes.write(" def %s(self" % func)
1099 txt.write(" %s()\n" % func)
1103 classes.write(", %s" % arg[0])
1105 classes.write("):\n")
1111 classes.write(" if %s is None: %s__o = None\n" %
1113 classes.write(" else: %s__o = %s%s\n" %
1117 classes.write(" ret = ")
1119 classes.write(" ")
1120 classes.write("libxml2mod.%s(" % name)
1124 classes.write(", ")
1126 classes.write("%s" % arg[0])
1128 classes.write("__o")
1130 classes.write("self")
1132 classes.write(classes_type[arg[1]][0])
1134 classes.write(")\n")
1141 classes.write(
1144 classes.write(
1148 classes.write(
1152 classes.write(
1156 classes.write(
1163 classes.write(" __tmp = ")
1164 classes.write(classes_type[ret[0]][1] % ("ret"))
1165 classes.write("\n")
1177 classes.write(" __tmp.%s = self\n" %
1182 classes.write(" return __tmp\n")
1188 classes.write(
1191 classes.write(
1195 classes.write(
1199 classes.write(
1203 classes.write(
1206 classes.write(" return ")
1207 classes.write(converter_type[ret[0]] % ("ret"))
1208 classes.write("\n")
1210 classes.write(" return ret\n")
1211 classes.write("\n")
1217 classes.write("# %s\n" % type)
1221 classes.write("%s = %s\n" % (name,value))
1222 classes.write("\n")