[python PATCH 2/2] Provide symbolic names for typed parameters

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



https://bugzilla.redhat.com/show_bug.cgi?id=1222795

Signed-off-by: Jiri Denemark <jdenemar@xxxxxxxxxx>
---
 generator.py | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/generator.py b/generator.py
index 676243c..2fc838c 100755
--- a/generator.py
+++ b/generator.py
@@ -10,6 +10,7 @@ enums = {} # { enumType: { enumConstant: enumValue } }
 lxc_enums = {} # { enumType: { enumConstant: enumValue } }
 qemu_enums = {} # { enumType: { enumConstant: enumValue } }
 event_ids = []
+params = [] # [ (parameName, paramValue)... ]
 
 import os
 import sys
@@ -134,6 +135,9 @@ class docParser(xml.sax.handler.ContentHandler):
                 lxc_enum(attrs['type'],attrs['name'],attrs['value'])
             elif attrs['file'] == "libvirt-qemu":
                 qemu_enum(attrs['type'],attrs['name'],attrs['value'])
+        elif tag == "macro":
+            if "string" in attrs:
+                params.append((attrs['name'], attrs['string']))
 
     def end(self, tag):
         if debug:
@@ -1881,6 +1885,10 @@ def buildWrappers(module):
             classes.write("%s = %s\n" % (name,value))
         classes.write("\n")
 
+    classes.write("# typed parameter names\n")
+    for name, value in params:
+        classes.write("%s = \"%s\"\n" % (name, value))
+
     classes.close()
 
 def qemuBuildWrappers(module):
-- 
2.4.2

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]