提交 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):
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):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册