[libvirt] [PATCH python 6/7] Removed unused 'converter_type' code from generator

Daniel P. Berrange berrange at redhat.com
Thu Jan 19 15:31:26 UTC 2017


The 'converter_type' data structure and associated code
in the generator is inherited from libxml. This has never
been used in libvirt, so delete it to simplify the generator.

Signed-off-by: Daniel P. Berrange <berrange at redhat.com>
---
 generator.py | 15 ---------------
 1 file changed, 15 deletions(-)

diff --git a/generator.py b/generator.py
index 3d2e05e..cf3759c 100755
--- a/generator.py
+++ b/generator.py
@@ -1009,9 +1009,6 @@ classes_type = {
     "virDomainSnapshot *": ("._o", "virDomainSnapshot(self, _obj=%s)", "virDomainSnapshot"),
 }
 
-converter_type = {
-}
-
 primary_classes = ["virDomain", "virNetwork", "virInterface",
                    "virStoragePool", "virStorageVol",
                    "virConnect", "virNodeDevice", "virSecret",
@@ -1281,7 +1278,6 @@ def buildWrappers(module):
     global classes_type
     global classes_list
     global primary_classes
-    global converter_type
     global classes_destructors
     global functions_noexcept
 
@@ -1634,17 +1630,6 @@ def buildWrappers(module):
                         # return the class
                         #
                         classes.write("        return __tmp\n")
-                    elif ret[0] in converter_type:
-                        #
-                        # Raise an exception
-                        #
-                        if name in functions_noexcept:
-                            classes.write(
-                                "        if ret is None:return None")
-
-                        classes.write("        return ")
-                        classes.write(converter_type[ret[0]] % ("ret"))
-                        classes.write("\n")
 
                     # For functions returning an integral type there
                     # are several things that we can do, depending on
-- 
2.9.3




More information about the libvir-list mailing list