本文整理汇总了Python中OpenIPMI.pefconfig_enum_idx方法的典型用法代码示例。如果您正苦于以下问题:Python OpenIPMI.pefconfig_enum_idx方法的具体用法?Python OpenIPMI.pefconfig_enum_idx怎么用?Python OpenIPMI.pefconfig_enum_idx使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OpenIPMI
的用法示例。
在下文中一共展示了OpenIPMI.pefconfig_enum_idx方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: import OpenIPMI [as 别名]
# 或者: from OpenIPMI import pefconfig_enum_idx [as 别名]
def __init__(self, m, pef, pefc):
gui_list.List.__init__(self,
"PEFPARMS for " + m.name,
[ ("Name", 250), ("Value", 250) ])
self.pef = pef
self.pefc = pefc
i = 0
j = 0
rv = True
v = [ 0 ]
while (rv):
lastv = v[0]
rv = pefc.get_val(i, v)
if (rv):
vals = rv.split(" ", 2)
if (len(vals) == 3):
# Valid parm
if (vals[1] == "integer"):
w = [ 0 ]
x = [ "" ]
err = OpenIPMI.pefconfig_enum_val(i, 0, w, x)
if (err != OpenIPMI.enosys):
vals[1] = "enum"
pass
pass
data = MCPEFData(self, pefc, i, lastv,
vals[0], vals[1], vals[2])
if (v[0] == 0):
title = vals[0]
else:
x = [ "" ]
err = OpenIPMI.pefconfig_enum_idx(i, lastv, x)
if (err):
title = vals[0] + "[" + str(lastv) + "]"
else:
title = vals[0] + "[" + x[0] + "]"
pass
pass
if (vals[1] == "enum"):
nval = [ 0 ]
sval = [ "" ]
OpenIPMI.pefconfig_enum_val(data.parm, int(vals[2]),
nval, sval)
value = sval[0]
pass
else:
value = vals[2]
pass
self.add_data(title, [ value ], data)
j += 1
if (v[0] == 0):
i += 1
pass
if (v[0] == -1):
i += 1
v[0] = 0
pass
pass
else:
v[0] = 0
i += 1
pass
pass
pass
self.AfterDone()
return