提交 25409b2d 编写于 作者: R Radostin Stoyanov 提交者: Daniel P. Berrangé

esx_vi_generator: Simplify generate_helper_header

The function generate_helper_header() only returns a formatted string.
This could be achieved without performing string concatenation.
Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
Signed-off-by: NRadostin Stoyanov <rstoyanov1@gmail.com>
上级 68106955
...@@ -1021,20 +1021,16 @@ class ManagedObject(GenericObject): ...@@ -1021,20 +1021,16 @@ class ManagedObject(GenericObject):
def generate_helper_header(self): def generate_helper_header(self):
header = ""
# functions # functions
header += ("int esxVI_Lookup%s(esxVI_Context *ctx, " return (
"const char *name, " "int esxVI_Lookup%(name)s(esxVI_Context *ctx,"
"esxVI_ManagedObjectReference *root, " " const char *name,"
"esxVI_String *selectedPropertyNameList, " " esxVI_ManagedObjectReference *root,"
"esxVI_%s **item, " " esxVI_String *selectedPropertyNameList,"
"esxVI_Occurrence occurrence);\n") \ " esxVI_%(name)s **item,"
% (self.name, self.name) " esxVI_Occurrence occurrence);\n\n"
% {"name": self.name}
header += "\n" )
return header
def generate_source(self): def generate_source(self):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册