本文整理汇总了Python中OpenIPMI.alloc_empty_args方法的典型用法代码示例。如果您正苦于以下问题:Python OpenIPMI.alloc_empty_args方法的具体用法?Python OpenIPMI.alloc_empty_args怎么用?Python OpenIPMI.alloc_empty_args使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OpenIPMI
的用法示例。
在下文中一共展示了OpenIPMI.alloc_empty_args方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: RestoreDomains
# 需要导入模块: import OpenIPMI [as 别名]
# 或者: from OpenIPMI import alloc_empty_args [as 别名]
def RestoreDomains(mainhandler):
for i in defaultDomains:
name = i[0]
attrhashes = i[1]
other = i[2]
connects = [ ]
for attrhash in attrhashes:
if ("contype" not in attrhash):
continue
args = OpenIPMI.alloc_empty_args(str(attrhash["contype"]))
if (args == None):
continue
for attr in attrhash.items():
vname = str(attr[0])
if (vname == "contype"):
continue
value = str(attr[1])
args.set_val(0, vname, value)
pass
connects.append(args)
pass
domain_id = OpenIPMI.open_domain3(name, [], connects, None, None)
if (domain_id != None):
DomainInfoSetup(other, domain_id)
pass
else:
_oi_logging.error("Error making domain connection for " + name)
pass
pass
return
示例2: __init__
# 需要导入模块: import OpenIPMI [as 别名]
# 或者: from OpenIPMI import alloc_empty_args [as 别名]
def __init__(self, contype, parent):
Tix.Frame.__init__(self, parent)
self.contype = contype
self.fields = [ ]
args = OpenIPMI.alloc_empty_args(str(contype))
self.args = args
self.errstr = gui_errstr.ErrStr(self)
self.errstr.pack(side=Tix.TOP, fill=Tix.X, expand=1)
i = 0
rv = 0
frame = None
while (rv == 0):
name = [ "" ]
vtype = [ "" ]
vrange = [ "" ]
vhelp = [ "" ]
value = [ "" ]
rv = args.get_val(i, name, vtype, vhelp, value, vrange)
if (rv == 0):
if (vhelp[0][0] == '*'):
optional = False
vhelp[0] = vhelp[0][1:]
else:
optional = True
pass
if (vhelp[0][0] == '!'):
password = True
vhelp[0] = vhelp[0][1:]
else:
password = False
pass
if (vtype[0] == "bool"):
if (frame == None):
didframe = True
frame = Tix.Frame(self)
frame.pack(side=Tix.TOP)
newframe = frame
pass
else:
newframe = None
pass
fw = Tix.BooleanVar()
w = Tix.Checkbutton(frame, text=name[0], variable=fw)
w.pack(side=Tix.LEFT, padx=10)
if ((value[0] != None) and (value[0] == "true")):
fw.set(True)
pass
pass
elif (vtype[0] == "enum"):
do_box = False
fw = EnumHolder()
if (value[0] != None):
fw.set(value[0])
pass
else:
fw.set(vrange[0])
pass
w = Tix.Select(self, label=name[0], allowzero=0, radio=1,
command=fw.SelectType)
for v in vrange:
w.add(v, text=v)
pass
newframe = None
w.invoke(fw.get())
w.pack()
pass
elif (vtype[0] == "str") or (vtype[0] == "int"):
if (frame == None):
didframe = True
frame = Tix.Frame(self)
frame.pack(side=Tix.TOP)
newframe = frame
pass
else:
newframe = None
pass
if (value[0] == None):
value[0] = ""
pass
if (password):
options="entry.show '*' entry.width 20"
else:
options="entry.width 20"
pass
w = Tix.LabelEntry(frame, label=name[0], options=options)
w.entry.insert(Tix.END, value[0])
w.pack(side=Tix.LEFT, padx=10)
fw = w.entry
pass
else:
i += 1
continue
frame = newframe
self.fields.append( (i, name[0], vtype[0], fw) )
pass
#.........这里部分代码省略.........