Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
35cdab71
L
libvirt
项目概览
openeuler
/
libvirt
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
L
libvirt
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
35cdab71
编写于
5月 01, 2011
作者:
M
Matthias Bolte
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
esx: Improve list usage detection in the generator
Detect it based on usage as parameter and return type too.
上级
59f1f5f1
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
31 addition
and
10 deletion
+31
-10
src/esx/esx_vi_generator.py
src/esx/esx_vi_generator.py
+31
-10
未找到文件。
src/esx/esx_vi_generator.py
浏览文件 @
35cdab71
...
...
@@ -1428,7 +1428,7 @@ additional_enum_features = { "ManagedEntityStatus" : Enum.FEATURE__ANY_TYPE
"VirtualMachinePowerState"
:
Enum
.
FEATURE__ANY_TYPE
}
additional_object_features
=
{
"AutoStartDefaults"
:
Object
.
FEATURE__ANY_TYPE
,
"AutoStartPowerInfo"
:
Object
.
FEATURE__ANY_TYPE
|
Object
.
FEATURE__LIST
,
"AutoStartPowerInfo"
:
Object
.
FEATURE__ANY_TYPE
,
"DatastoreHostMount"
:
Object
.
FEATURE__DEEP_COPY
|
Object
.
FEATURE__LIST
|
Object
.
FEATURE__ANY_TYPE
,
"DatastoreInfo"
:
Object
.
FEATURE__ANY_TYPE
|
Object
.
FEATURE__DYNAMIC_CAST
,
"FileInfo"
:
Object
.
FEATURE__DYNAMIC_CAST
,
...
...
@@ -1437,12 +1437,9 @@ additional_object_features = { "AutoStartDefaults" : Object.FEATURE__AN
"HostCpuIdInfo"
:
Object
.
FEATURE__ANY_TYPE
|
Object
.
FEATURE__LIST
,
"HostDatastoreBrowserSearchResults"
:
Object
.
FEATURE__LIST
|
Object
.
FEATURE__ANY_TYPE
,
"ManagedObjectReference"
:
Object
.
FEATURE__ANY_TYPE
,
"ObjectContent"
:
Object
.
FEATURE__DEEP_COPY
|
Object
.
FEATURE__LIST
,
"PerfCounterInfo"
:
Object
.
FEATURE__LIST
,
"PerfEntityMetric"
:
Object
.
FEATURE__LIST
|
Object
.
FEATURE__DYNAMIC_CAST
,
"PerfQuerySpec"
:
Object
.
FEATURE__LIST
,
"ObjectContent"
:
Object
.
FEATURE__DEEP_COPY
,
"PerfEntityMetric"
:
Object
.
FEATURE__DYNAMIC_CAST
,
"PerfMetricIntSeries"
:
Object
.
FEATURE__DYNAMIC_CAST
,
"PropertyFilterSpec"
:
Object
.
FEATURE__LIST
,
"ResourcePoolResourceUsage"
:
Object
.
FEATURE__ANY_TYPE
,
"SelectionSpec"
:
Object
.
FEATURE__DYNAMIC_CAST
,
"ServiceContent"
:
Object
.
FEATURE__DESERIALIZE
,
...
...
@@ -1541,6 +1538,15 @@ for method in methods_by_name.values():
else
:
objects_by_name
[
parameter
.
type
].
features
|=
Object
.
FEATURE__SERIALIZE
# detect list usage
if
parameter
.
occurrence
==
OCCURRENCE__REQUIRED_LIST
or
\
parameter
.
occurrence
==
OCCURRENCE__OPTIONAL_LIST
:
if
parameter
.
is_enum
():
report_error
(
"unsupported usage of enum '%s' as list in '%s'"
%
(
parameter
.
type
,
method
.
name
))
else
:
objects_by_name
[
parameter
.
type
].
features
|=
Object
.
FEATURE__LIST
# method return types must be deserializable
if
method
.
returns
and
method
.
returns
.
is_type_generated
():
if
method
.
returns
.
is_enum
():
...
...
@@ -1548,6 +1554,15 @@ for method in methods_by_name.values():
else
:
objects_by_name
[
method
.
returns
.
type
].
features
|=
Object
.
FEATURE__DESERIALIZE
# detect list usage
if
method
.
returns
.
occurrence
==
OCCURRENCE__REQUIRED_LIST
or
\
method
.
returns
.
occurrence
==
OCCURRENCE__OPTIONAL_LIST
:
if
method
.
returns
.
is_enum
():
report_error
(
"unsupported usage of enum '%s' as list in '%s'"
%
(
method
.
returns
.
type
,
method
.
name
))
else
:
objects_by_name
[
method
.
returns
.
type
].
features
|=
Object
.
FEATURE__LIST
for
enum
in
enums_by_name
.
values
():
...
...
@@ -1572,10 +1587,16 @@ for obj in objects_by_name.values():
# detect list usage
for
property
in
obj
.
properties
:
if
(
property
.
occurrence
==
OCCURRENCE__REQUIRED_LIST
or
\
property
.
occurrence
==
OCCURRENCE__OPTIONAL_LIST
)
and
\
property
.
type
not
in
predefined_objects
:
objects_by_name
[
property
.
type
].
features
|=
Object
.
FEATURE__LIST
if
not
property
.
is_type_generated
():
continue
if
property
.
occurrence
==
OCCURRENCE__REQUIRED_LIST
or
\
property
.
occurrence
==
OCCURRENCE__OPTIONAL_LIST
:
if
property
.
is_enum
():
report_error
(
"unsupported usage of enum '%s' as list in '%s'"
%
(
property
.
type
,
obj
.
type
))
else
:
objects_by_name
[
property
.
type
].
features
|=
Object
.
FEATURE__LIST
# apply/remove additional features
if
obj
.
name
in
additional_object_features
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录