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("#define PY_SSIZE_T_CLEAN\n")
559 wrapper.write("#include <Python.h>\n")
560 wrapper.write("#include <libxml/xmlversion.h>\n")
561 wrapper.write("#include <libxml/tree.h>\n")
562 wrapper.write("#include <libxml/xmlschemastypes.h>\n")
563 wrapper.write("#include \"libxml_wrap.h\"\n")
564 wrapper.write("#include \"libxml2-py.h\"\n\n")
830 output.write(indent)
831 output.write('"""')
842 output.write(str)
843 output.write('\n ')
844 output.write(indent)
845 output.write(val)
846 output.write(' """\n')
939 txt.write(" Generated Classes for libxml2-python\n\n")
941 txt.write("#\n# Global functions of the module\n#\n\n")
949 classes.write("#\n# Functions from module %s\n#\n\n" % file)
950 txt.write("\n# functions from module %s\n" % file)
952 classes.write("def %s(" % func)
953 txt.write("%s()\n" % func)
957 classes.write(", ")
958 classes.write("%s" % arg[0])
960 classes.write("):\n")
965 classes.write(" if %s is None: %s__o = None\n" %
967 classes.write(" else: %s__o = %s%s\n" %
972 classes.write(" if %s is not None: %s.flush()\n" % (
976 classes.write(" ret = ")
978 classes.write(" ")
979 classes.write("libxml2mod.%s(" % name)
983 classes.write(", ")
984 classes.write("%s" % arg[0])
986 classes.write("__o")
988 classes.write(")\n")
1005 classes.write(" if ret is None:return None\n")
1007 classes.write(
1011 classes.write(
1015 classes.write(
1019 classes.write(
1022 classes.write(" return ")
1023 classes.write(classes_type[ret[0]][1] % ("ret"))
1024 classes.write("\n")
1026 classes.write(" return ret\n")
1027 classes.write("\n")
1029 txt.write("\n\n#\n# Set of classes of the module\n#\n\n")
1035 txt.write("\n\nClass %s(%s)\n" % (classname,
1037 classes.write("class %s(%s):\n" % (classname,
1039 classes.write(" def __init__(self, _obj=None):\n")
1042 classes.write(" if checkWrapper(_obj) != 0:")
1043 classes.write(" raise TypeError")
1044 classes.write("('%s got a wrong wrapper object type')\n" % \
1049 classes.write(" self.%s = None\n" % ref[1])
1050 classes.write(" self._o = _obj\n")
1051 classes.write(" %s.__init__(self, _obj=_obj)\n\n" % (
1055 classes.write(" def __repr__(self):\n")
1057 classes.write(" return \"%s\" %% (self.name, int(pos_id (self)))\n\n" % (
1060 txt.write("Class %s()\n" % (classname))
1061 classes.write("class %s:\n" % (classname))
1062 classes.write(" def __init__(self, _obj=None):\n")
1066 classes.write(" self.%s = None\n" % ref[1])
1067 classes.write(" if _obj != None:self._o = _obj;return\n")
1068 classes.write(" self._o = None\n\n")
1071 classes.write(" def __del__(self):\n")
1072 classes.write(" if self._o != None:\n")
1073 classes.write(" libxml2mod.%s(self._o)\n" %
1075 classes.write(" self._o = None\n\n")
1090 classes.write(" # accessors for %s\n" % (classname))
1091 txt.write(" # accessors\n")
1093 classes.write(" #\n")
1094 classes.write(" # %s functions from module %s\n" % (
1096 txt.write("\n # functions from module %s\n" % file)
1097 classes.write(" #\n\n")
1099 classes.write(" def %s(self" % func)
1100 txt.write(" %s()\n" % func)
1104 classes.write(", %s" % arg[0])
1106 classes.write("):\n")
1112 classes.write(" if %s is None: %s__o = None\n" %
1114 classes.write(" else: %s__o = %s%s\n" %
1118 classes.write(" ret = ")
1120 classes.write(" ")
1121 classes.write("libxml2mod.%s(" % name)
1125 classes.write(", ")
1127 classes.write("%s" % arg[0])
1129 classes.write("__o")
1131 classes.write("self")
1133 classes.write(classes_type[arg[1]][0])
1135 classes.write(")\n")
1142 classes.write(
1145 classes.write(
1149 classes.write(
1153 classes.write(
1157 classes.write(
1164 classes.write(" __tmp = ")
1165 classes.write(classes_type[ret[0]][1] % ("ret"))
1166 classes.write("\n")
1178 classes.write(" __tmp.%s = self\n" %
1183 classes.write(" return __tmp\n")
1189 classes.write(
1192 classes.write(
1196 classes.write(
1200 classes.write(
1204 classes.write(
1207 classes.write(" return ")
1208 classes.write(converter_type[ret[0]] % ("ret"))
1209 classes.write("\n")
1211 classes.write(" return ret\n")
1212 classes.write("\n")
1218 classes.write("# %s\n" % type)
1222 classes.write("%s = %s\n" % (name,value))
1223 classes.write("\n")