[PATCHv2 06/25] esx_vi_generator: Simplify generate_helper_header

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

 



The function generate_helper_header() only returns a formatted string.
This could be achieved without performing string concatenation.

Signed-off-by: Radostin Stoyanov <rstoyanov1@xxxxxxxxx>
---
 src/esx/esx_vi_generator.py | 22 +++++++++-------------
 1 file changed, 9 insertions(+), 13 deletions(-)

diff --git a/src/esx/esx_vi_generator.py b/src/esx/esx_vi_generator.py
index 8f581c41e..95521fa1e 100755
--- a/src/esx/esx_vi_generator.py
+++ b/src/esx/esx_vi_generator.py
@@ -1021,20 +1021,16 @@ class ManagedObject(GenericObject):
 
 
     def generate_helper_header(self):
-        header = ""
-
         # functions
-        header += ("int esxVI_Lookup%s(esxVI_Context *ctx, "
-                                      "const char *name, "
-                                      "esxVI_ManagedObjectReference *root, "
-                                      "esxVI_String *selectedPropertyNameList, "
-                                      "esxVI_%s **item, "
-                                      "esxVI_Occurrence occurrence);\n") \
-                  % (self.name, self.name)
-
-        header += "\n"
-
-        return header
+        return (
+            "int esxVI_Lookup%(name)s(esxVI_Context *ctx,"
+                                     " const char *name,"
+                                     " esxVI_ManagedObjectReference *root,"
+                                     " esxVI_String *selectedPropertyNameList,"
+                                     " esxVI_%(name)s **item,"
+                                     " esxVI_Occurrence occurrence);\n\n"
+            % {"name": self.name}
+        )
 
 
     def generate_source(self):
-- 
2.14.3

--
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]

  Powered by Linux