本文整理汇总了Python中OpenIPMI.open_domain2方法的典型用法代码示例。如果您正苦于以下问题:Python OpenIPMI.open_domain2方法的具体用法?Python OpenIPMI.open_domain2怎么用?Python OpenIPMI.open_domain2使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OpenIPMI
的用法示例。
在下文中一共展示了OpenIPMI.open_domain2方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: log
# 需要导入模块: import OpenIPMI [as 别名]
# 或者: from OpenIPMI import open_domain2 [as 别名]
return
def log(self, level, log):
print level + ": " + log
return
pass
OpenIPMI.enable_debug_malloc()
OpenIPMI.init_posix()
main_handler = Handlers("hello")
OpenIPMI.set_log_handler(main_handler)
a = OpenIPMI.open_domain2("test", sys.argv[1:], main_handler, main_handler)
if not a:
print "open failed"
sys.exit(1)
pass
del a
while main_handler.name != "done":
OpenIPMI.wait_io(1000)
pass
class DummyLogHandler:
def __init__(self):
pass
def log(self, level, log):
示例2: __init__
# 需要导入模块: import OpenIPMI [as 别名]
# 或者: from OpenIPMI import open_domain2 [as 别名]
class DummyLogHandler:
def __init__(self):
pass
def log(self, level, log):
sys.stderr.write(level + ": " + log + "\n")
OpenIPMI.enable_debug_malloc()
OpenIPMI.init_posix()
main_handler = Handlers("hello")
OpenIPMI.set_log_handler(main_handler)
a = OpenIPMI.open_domain2("test", ["-noall",] + sys.argv[1:],
main_handler, main_handler)
if not a:
print "open failed"
sys.exit(1)
pass
del a
nexttime = time.time()
num_poll = 1
while main_handler.name != "done" and num_poll <= 2:
OpenIPMI.wait_io(1000)
now = time.time()
if main_handler.mc and now >= nexttime:
nexttime += 5
num_poll += 1
if num_poll < 2: