当前位置: 首页>>代码示例>>Python>>正文


Python OpenIPMI.lanconfig_enum_idx方法代码示例

本文整理汇总了Python中OpenIPMI.lanconfig_enum_idx方法的典型用法代码示例。如果您正苦于以下问题:Python OpenIPMI.lanconfig_enum_idx方法的具体用法?Python OpenIPMI.lanconfig_enum_idx怎么用?Python OpenIPMI.lanconfig_enum_idx使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OpenIPMI的用法示例。


在下文中一共展示了OpenIPMI.lanconfig_enum_idx方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: import OpenIPMI [as 别名]
# 或者: from OpenIPMI import lanconfig_enum_idx [as 别名]
    def __init__(self, m, lp, lpc, channel):
        gui_list.List.__init__(self,
                               ("LANPARMS for " + m.name + " channel "
                                + str(channel)),
                               [ ("Name", 250), ("Value", 250) ])
        self.lp = lp
        self.lpc = lpc
        self.channel = channel
        
        i = 0
        j = 0
        rv = True
        v = [ 0 ]
        while (rv):
            lastv = v[0]
            rv = lpc.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.lanconfig_enum_val(i, 0, w, x)
                        if (err != OpenIPMI.enosys):
                            vals[1] = "enum"
                            pass
                        pass
                    
                    data = MCLPData(self, lpc, i, lastv,
                                    vals[0], vals[1], vals[2])

                    if (v[0] == 0):
                        title = vals[0]
                    else:
                        x = [ "" ]
                        err = OpenIPMI.lanconfig_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.lanconfig_enum_val(i, 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
开发者ID:sharkconi,项目名称:openipmi,代码行数:76,代码来源:_mc_lanparm.py


注:本文中的OpenIPMI.lanconfig_enum_idx方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。