mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-12-20 00:24:48 +03:00
* //* : renamed the project libvirt , this affects all makefiles,
the specs, the icons, the docs, etc ... * configure.in: prepare for 0.0.3 Daniel
This commit is contained in:
@@ -20,7 +20,7 @@ else:
|
||||
#######################################################################
|
||||
#
|
||||
# That part if purely the API acquisition phase from the
|
||||
# libvir API description
|
||||
# libvirt API description
|
||||
#
|
||||
#######################################################################
|
||||
import os
|
||||
@@ -354,13 +354,13 @@ def print_function_wrapper(name, output, export, include):
|
||||
c_call = "\n c_retval = %s->%s;\n" % (args[0][0], ret[2])
|
||||
else:
|
||||
c_call = "\n c_retval = %s(%s);\n" % (name, c_call);
|
||||
ret_convert = " py_retval = libvir_%sWrap((%s) c_retval);\n" % (n,c)
|
||||
ret_convert = " py_retval = libvirt_%sWrap((%s) c_retval);\n" % (n,c)
|
||||
ret_convert = ret_convert + " return(py_retval);\n"
|
||||
elif py_return_types.has_key(ret[0]):
|
||||
(f, t, n, c) = py_return_types[ret[0]]
|
||||
c_return = " %s c_retval;\n" % (ret[0])
|
||||
c_call = "\n c_retval = %s(%s);\n" % (name, c_call);
|
||||
ret_convert = " py_retval = libvir_%sWrap((%s) c_retval);\n" % (n,c)
|
||||
ret_convert = " py_retval = libvirt_%sWrap((%s) c_retval);\n" % (n,c)
|
||||
ret_convert = ret_convert + " return(py_retval);\n"
|
||||
else:
|
||||
if skipped_types.has_key(ret[0]):
|
||||
@@ -378,9 +378,9 @@ def print_function_wrapper(name, output, export, include):
|
||||
output.write("#if %s\n" % cond)
|
||||
|
||||
include.write("PyObject * ")
|
||||
include.write("libvir_%s(PyObject *self, PyObject *args);\n" % (name));
|
||||
include.write("libvirt_%s(PyObject *self, PyObject *args);\n" % (name));
|
||||
|
||||
export.write(" { (char *)\"%s\", libvir_%s, METH_VARARGS, NULL },\n" %
|
||||
export.write(" { (char *)\"%s\", libvirt_%s, METH_VARARGS, NULL },\n" %
|
||||
(name, name))
|
||||
|
||||
if file == "python":
|
||||
@@ -399,7 +399,7 @@ def print_function_wrapper(name, output, export, include):
|
||||
return 1
|
||||
|
||||
output.write("PyObject *\n")
|
||||
output.write("libvir_%s(PyObject *self ATTRIBUTE_UNUSED," % (name))
|
||||
output.write("libvirt_%s(PyObject *self ATTRIBUTE_UNUSED," % (name))
|
||||
output.write(" PyObject *args")
|
||||
if format == "":
|
||||
output.write(" ATTRIBUTE_UNUSED")
|
||||
@@ -432,14 +432,14 @@ def buildStubs():
|
||||
global unknown_types
|
||||
|
||||
try:
|
||||
f = open(os.path.join(srcPref,"libvir-api.xml"))
|
||||
f = open(os.path.join(srcPref,"libvirt-api.xml"))
|
||||
data = f.read()
|
||||
(parser, target) = getparser()
|
||||
parser.feed(data)
|
||||
parser.close()
|
||||
except IOError, msg:
|
||||
try:
|
||||
f = open(os.path.join(srcPref,"..","docs","libvir-api.xml"))
|
||||
f = open(os.path.join(srcPref,"..","docs","libvirt-api.xml"))
|
||||
data = f.read()
|
||||
(parser, target) = getparser()
|
||||
parser.feed(data)
|
||||
@@ -449,11 +449,11 @@ def buildStubs():
|
||||
sys.exit(1)
|
||||
|
||||
n = len(functions.keys())
|
||||
print "Found %d functions in libvir-api.xml" % (n)
|
||||
print "Found %d functions in libvirt-api.xml" % (n)
|
||||
|
||||
py_types['pythonObject'] = ('O', "pythonObject", "pythonObject", "pythonObject")
|
||||
try:
|
||||
f = open(os.path.join(srcPref,"libvir-python-api.xml"))
|
||||
f = open(os.path.join(srcPref,"libvirt-python-api.xml"))
|
||||
data = f.read()
|
||||
(parser, target) = getparser()
|
||||
parser.feed(data)
|
||||
@@ -462,22 +462,22 @@ def buildStubs():
|
||||
print file, ":", msg
|
||||
|
||||
|
||||
print "Found %d functions in libvir-python-api.xml" % (
|
||||
print "Found %d functions in libvirt-python-api.xml" % (
|
||||
len(functions.keys()) - n)
|
||||
nb_wrap = 0
|
||||
failed = 0
|
||||
skipped = 0
|
||||
|
||||
include = open("libvir-py.h", "w")
|
||||
include = open("libvirt-py.h", "w")
|
||||
include.write("/* Generated */\n\n")
|
||||
export = open("libvir-export.c", "w")
|
||||
export = open("libvirt-export.c", "w")
|
||||
export.write("/* Generated */\n\n")
|
||||
wrapper = open("libvir-py.c", "w")
|
||||
wrapper = open("libvirt-py.c", "w")
|
||||
wrapper.write("/* Generated */\n\n")
|
||||
wrapper.write("#include <Python.h>\n")
|
||||
wrapper.write("#include <libvir.h>\n")
|
||||
wrapper.write("#include \"libvir_wrap.h\"\n")
|
||||
wrapper.write("#include \"libvir-py.h\"\n\n")
|
||||
wrapper.write("#include <libvirt.h>\n")
|
||||
wrapper.write("#include \"libvirt_wrap.h\"\n")
|
||||
wrapper.write("#include \"libvirt-py.h\"\n\n")
|
||||
for function in functions.keys():
|
||||
ret = print_function_wrapper(function, wrapper, export, include)
|
||||
if ret < 0:
|
||||
@@ -685,19 +685,19 @@ def buildWrappers():
|
||||
info = (0, func, name, ret, args, file)
|
||||
function_classes['None'].append(info)
|
||||
|
||||
classes = open("libvir.py", "w")
|
||||
classes = open("libvirt.py", "w")
|
||||
classes.write("""#!/usr/bin/python -u
|
||||
#
|
||||
# Those are the autogenerated Python bindings for libvir.
|
||||
# Check python/generator.py in the source distribution of libvir
|
||||
# Those are the autogenerated Python bindings for libvirt.
|
||||
# Check python/generator.py in the source distribution of libvirt
|
||||
# to find out more about the generation process
|
||||
#
|
||||
""")
|
||||
|
||||
classes.write("import libvirmod\n")
|
||||
classes.write("import libvirtmod\n")
|
||||
classes.write("import types\n\n")
|
||||
|
||||
txt = open("libvirclass.txt", "w")
|
||||
txt = open("libvirtclass.txt", "w")
|
||||
txt.write(" Generated Classes for libvir-python\n\n")
|
||||
|
||||
txt.write("#\n# Global functions of the module\n#\n\n")
|
||||
@@ -732,7 +732,7 @@ def buildWrappers():
|
||||
classes.write(" ret = ");
|
||||
else:
|
||||
classes.write(" ");
|
||||
classes.write("libvirmod.%s(" % name)
|
||||
classes.write("libvirtmod.%s(" % name)
|
||||
n = 0
|
||||
for arg in args:
|
||||
if n != 0:
|
||||
@@ -788,7 +788,7 @@ def buildWrappers():
|
||||
if classes_destructors.has_key(classname):
|
||||
classes.write(" def __del__(self):\n")
|
||||
classes.write(" if self._o != None:\n")
|
||||
classes.write(" libvirmod.%s(self._o)\n" %
|
||||
classes.write(" libvirtmod.%s(self._o)\n" %
|
||||
classes_destructors[classname]);
|
||||
classes.write(" self._o = None\n\n");
|
||||
destruct=classes_destructors[classname]
|
||||
@@ -836,7 +836,7 @@ def buildWrappers():
|
||||
classes.write(" ret = ");
|
||||
else:
|
||||
classes.write(" ");
|
||||
classes.write("libvirmod.%s(" % name)
|
||||
classes.write("libvirtmod.%s(" % name)
|
||||
n = 0
|
||||
for arg in args:
|
||||
if n != 0:
|
||||
|
||||
Reference in New Issue
Block a user