本文整理汇总了Python中interface.Interface.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Interface.__init__方法的具体用法?Python Interface.__init__怎么用?Python Interface.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类interface.Interface
的用法示例。
在下文中一共展示了Interface.__init__方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from interface import Interface [as 别名]
# 或者: from interface.Interface import __init__ [as 别名]
def __init__(self):
'''setup the serial device handler. Once this object is created,
you must call destroy() before exiting.
Updates are typles in one of three formats:
('BATTERY', <battery level>) # system battery level
('SHUTDOWN', None) # system has recieved a shutdown command
('CONTROL', <control update>) # button press
'''
Interface.__init__(self)
self.kill_flag = False
self.battery = 100 # current battery level
self.controls = None # current control state
self.do_shutdown = True # flag for shutting down unit on destroy()
# try to open the serial ports and handler threads
try:
# serial port uses long reads to block and timeouts to wake back up
self.pwr_port = serial.Serial(PWR_NAME, timeout=TIMEOUT, writeTimeout=TIMEOUT)
self.pwr_port.baudrate = BAUD
thread = threading.Thread(target=self.pwr_thread)
thread.start()
except: print 'Could not open power device'
try:
# conn port uses a similar structure, timeouts determine how long to block for
self.con_port = serial.Serial(CON_NAME, timeout=TIMEOUT, writeTimeout=TIMEOUT)
self.con_port.baudrate = BAUD
thread = threading.Thread(target=self.con_thread)
thread.start()
except: print 'Could not open controller device'
示例2: __init__
# 需要导入模块: from interface import Interface [as 别名]
# 或者: from interface.Interface import __init__ [as 别名]
def __init__(self):
Interface.__init__(self, "RSC")
Configurable.__init__(self)
LOG("Created")
self.toCheck = [ 'TM', 'TC' ]
self.rscStatus = {}
self.rscCallbacks = []
示例3: __init__
# 需要导入模块: from interface import Interface [as 别名]
# 或者: from interface.Interface import __init__ [as 别名]
def __init__(self):
Interface.__init__(self, "TC")
Configurable.__init__(self)
self.__lastStatus = None
self.__lastElement = None
self.__useConfig = {}
LOG("Created")
示例4: __init__
# 需要导入模块: from interface import Interface [as 别名]
# 或者: from interface.Interface import __init__ [as 别名]
def __init__(self, cni, mac, host_ifname, tag):
self.pid = os.getpid()
self.container_mac = mac
self.host_ifname = host_ifname
self.vlan_tag = tag
self.vlan_ifname = CniMacVlan._make_vlan_intf_name(tag)
CniInterface.__init__(self, cni)
return
示例5: __init__
# 需要导入模块: from interface import Interface [as 别名]
# 或者: from interface.Interface import __init__ [as 别名]
def __init__(self):
Interface.__init__(self, "TM")
Configurable.__init__(self)
self.__tmParameters = {}
self.__verifiers = []
self.__verifTable = []
self.__verifMutex = thread.allocate_lock()
self.__ctxName = None
LOG("Created")
示例6: __init__
# 需要导入模块: from interface import Interface [as 别名]
# 或者: from interface.Interface import __init__ [as 别名]
def __init__(self, probeIp):
Interface.__init__(self, probeIp)
# Thread.__init__(self)
# self.setName("Cli")
self.isRunning = True
# wins and boxes
self.status = None
self.commandInput = None
self.text = None
self.probesPanel = None
示例7: __init__
# 需要导入模块: from interface import Interface [as 别名]
# 或者: from interface.Interface import __init__ [as 别名]
def __init__(self, ip):
Interface.__init__(self, ip)
self.commandHistory = []
self.mainWin = Tk()
self.command = StringVar(self.mainWin)
self.status = StringVar(self.mainWin, value="Waiting for command ...")
self.text = StringVar(self.mainWin, value="Enter a command :")
self.result = None
self.probesDisplay = None
self.mainWin.title("Commander for probe with ip : " + ip)
self.isRunning = True
self.mainWin.protocol("WM_DELETE_WINDOW", self.quit)
# define the threads
self.thProbe = Thread(target=self.updateProbes, name="Probe updater", daemon=True)
self.thResults = Thread(target=self.updateResults, name="Results Updater", daemon=True)
示例8: __init__
# 需要导入模块: from interface import Interface [as 别名]
# 或者: from interface.Interface import __init__ [as 别名]
def __init__(self, type, name, members):
Interface.__init__(self, type, name, members)
示例9: __init__
# 需要导入模块: from interface import Interface [as 别名]
# 或者: from interface.Interface import __init__ [as 别名]
def __init__(self):
Interface.__init__(self, "USR")
Configurable.__init__(self)
LOG("Created")
示例10: __init__
# 需要导入模块: from interface import Interface [as 别名]
# 或者: from interface.Interface import __init__ [as 别名]
def __init__(self):
Interface.__init__(self, "MEM")
Configurable.__init__(self)
self.__ctxName = None
LOG("Created")
示例11: __init__
# 需要导入模块: from interface import Interface [as 别名]
# 或者: from interface.Interface import __init__ [as 别名]
def __init__(self):
Interface.__init__(self, "CONFIG")
LOG("Created")
示例12: __init__
# 需要导入模块: from interface import Interface [as 别名]
# 或者: from interface.Interface import __init__ [as 别名]
def __init__(self, object_path):
Interface.__init__(self, object_path)
self.dev_iface = dbus.Interface(self.object, DEVICE_IFACE)
示例13: __init__
# 需要导入模块: from interface import Interface [as 别名]
# 或者: from interface.Interface import __init__ [as 别名]
def __init__(self, cni, mac):
self.host_ifname = CniVEthPair._build_tapname(cni.container_uuid)
self.container_mac = mac
self.pid = os.getpid()
CniInterface.__init__(self, cni)
return
示例14: __init__
# 需要导入模块: from interface import Interface [as 别名]
# 或者: from interface.Interface import __init__ [as 别名]
def __init__(self, probeIp, command):
Interface.__init__(self, probeIp)
self.args = self.parseCommand(command)
self.out = ""
示例15: __init__
# 需要导入模块: from interface import Interface [as 别名]
# 或者: from interface.Interface import __init__ [as 别名]
def __init__(self, probeIp):
Interface.__init__(self, probeIp)
self.prompt = self.PROMPT % (self.targetId, self.targetIp)
self.isRunning = True
self.status = None
self.commandInput = None