本文整理汇总了Python中OpenIPMI.sol_state_string方法的典型用法代码示例。如果您正苦于以下问题:Python OpenIPMI.sol_state_string方法的具体用法?Python OpenIPMI.sol_state_string怎么用?Python OpenIPMI.sol_state_string使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OpenIPMI
的用法示例。
在下文中一共展示了OpenIPMI.sol_state_string方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: sol_connection_state_change
# 需要导入模块: import OpenIPMI [as 别名]
# 或者: from OpenIPMI import sol_state_string [as 别名]
def sol_connection_state_change(self, conn, state, err):
if (self.in_destroy):
return
if (err != 0):
self.errstr.SetError("Connection change: "
+ OpenIPMI.sol_state_string(state)
+ " " + OpenIPMI.get_error_string(err))
pass
self.statestr.SetError(OpenIPMI.sol_state_string(state))
if ((self.state != OpenIPMI.sol_state_closed)
and (state == OpenIPMI.sol_state_closed)):
self.filemenu.entryconfigure("Open", state="normal")
self.filemenu.entryconfigure("Close", state="disabled")
self.filemenu.entryconfigure("Force Close", state="disabled")
self.ctrlmenu.entryconfigure("Use Encryption", state="normal")
self.ctrlmenu.entryconfigure("Use Authentication", state="normal")
self.ctrlmenu.entryconfigure("Deassert CTS/DCD/DSR on connect",
state="normal")
self.ctrlmenu.entryconfigure("CTS Assertable", state="disabled")
self.ctrlmenu.entryconfigure("DCD/DSR Asserted", state="disabled")
self.ctrlmenu.entryconfigure("RI Asserted", state="disabled")
self.ctrlmenu.entryconfigure("Send Break", state="disabled")
for f in self.fmenus:
self.flushmenu.entryconfigure(f, state="disabled")
pass
pass
elif ((self.state == OpenIPMI.sol_state_closed)
and (state != OpenIPMI.sol_state_closed)):
self.filemenu.entryconfigure("Open", state="disabled")
self.filemenu.entryconfigure("Close", state="normal")
self.filemenu.entryconfigure("Force Close", state="normal")
self.ctrlmenu.entryconfigure("Use Encryption", state="disabled")
self.ctrlmenu.entryconfigure("Use Authentication",
state="disabled")
self.ctrlmenu.entryconfigure("Deassert CTS/DCD/DSR on connect",
state="disabled")
self.ctrlmenu.entryconfigure("CTS Assertable", state="normal")
self.ctrlmenu.entryconfigure("DCD/DSR Asserted", state="normal")
self.ctrlmenu.entryconfigure("RI Asserted", state="normal")
self.ctrlmenu.entryconfigure("Send Break", state="normal")
for f in self.fmenus:
self.flushmenu.entryconfigure(f, state="normal")
pass
pass
self.state = state
return
示例2: __init__
# 需要导入模块: import OpenIPMI [as 别名]
# 或者: from OpenIPMI import sol_state_string [as 别名]
#.........这里部分代码省略.........
self.ri = Tix.BooleanVar()
self.ri.set(False)
ctrlmenu.add_checkbutton(label="RI Asserted",
variable=self.ri,
command=self.RIToggle,
state="disabled")
ctrlmenu.add_command(label="Set Ack Timeout",
command=self.SetAckTimeout)
ctrlmenu.add_command(label="Set Ack Retries",
command=self.SetAckRetries)
ctrlmenu.add_command(label="Send Break",
command=self.SendBreak, state="disabled")
sermenu = Tix.Menu(ctrlmenu, tearoff=0)
ctrlmenu.add_cascade(label="Serial Rate", menu=sermenu)
self.servar = Tix.StringVar()
self.servar.set("default")
sermenu.add_radiobutton(label="Default", value="default",
variable=self.servar, command=self.SetRate)
sermenu.add_radiobutton(label="9600", value="9600",
variable=self.servar, command=self.SetRate)
sermenu.add_radiobutton(label="19200", value="19200",
variable=self.servar, command=self.SetRate)
sermenu.add_radiobutton(label="38400", value="38400",
variable=self.servar, command=self.SetRate)
sermenu.add_radiobutton(label="57600", value="57600",
variable=self.servar, command=self.SetRate)
sermenu.add_radiobutton(label="115200", value="115200",
variable=self.servar, command=self.SetRate)
serbehavemenu = Tix.Menu(ctrlmenu, tearoff=0)
ctrlmenu.add_cascade(label="Serial Alert Behavior", menu=serbehavemenu)
self.serbehave = Tix.StringVar()
self.serbehave.set("fail")
serbehavemenu.add_radiobutton(label="Serial Alerts Fail", value="fail",
variable=self.serbehave,
command=self.SetSerialAlerts)
serbehavemenu.add_radiobutton(label="Serial Alerts Deferred",
value="defer",
variable=self.serbehave,
command=self.SetSerialAlerts)
serbehavemenu.add_radiobutton(label="Serial Alerts Succeed",
value="succeed",
variable=self.serbehave,
command=self.SetSerialAlerts)
flushmenu = Tix.Menu(ctrlmenu, tearoff=0)
self.flushmenu = flushmenu
ctrlmenu.add_cascade(label="Queue Flush", menu=flushmenu)
fmenus = [ ]
flushmenu.add_command(label="Flush BMC Transmit Queue",
command=self.FlushBMCXmit,
state="disabled")
fmenus.append("Flush BMC Transmit Queue")
flushmenu.add_command(label="Flush BMC Receive Queue",
command=self.FlushBMCRecv,
state="disabled")
fmenus.append("Flush BMC Receive Queue")
flushmenu.add_command(label="Flush My Transmit Queue",
command=self.FlushMyXmit,
state="disabled")
fmenus.append("Flush My Transmit Queue")
flushmenu.add_command(label="Flush My Receive Queue",
command=self.FlushMyRecv,
state="disabled")
fmenus.append("Flush My Receive Queue")
flushmenu.add_command(label="Flush BMC Queues",
command=self.FlushBMC,
state="disabled")
fmenus.append("Flush BMC Queues")
flushmenu.add_command(label="Flush My Queues",
command=self.FlushMe,
state="disabled")
fmenus.append("Flush My Queues")
flushmenu.add_command(label="Flush All Queues",
command=self.FlushAll,
state="disabled")
fmenus.append("Flush All Queues")
self.fmenus = fmenus
mbar.pack(side=Tix.TOP, fill=Tix.X, expand=1)
fileb.pack(side=Tix.LEFT)
ctrlb.pack(side=Tix.LEFT)
self.term = SolTerm(self, self)
f = Tix.Frame(self)
f.pack(side=Tix.BOTTOM, fill=Tix.X, expand=1)
self.errstr = gui_errstr.ErrStr(f)
self.errstr.pack(side=Tix.LEFT, fill=Tix.X, expand=1)
self.statestr = gui_errstr.ErrStr(f)
self.statestr.pack(side=Tix.LEFT, fill=Tix.X, expand=1)
self.statestr.SetError(OpenIPMI.sol_state_string(
OpenIPMI.sol_state_closed))
self.state = OpenIPMI.sol_state_closed
self.bind("<Destroy>", self.OnDestroy)
return