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


Python Interface.__init__方法代码示例

本文整理汇总了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'
开发者ID:jpanikulam,项目名称:visar,代码行数:34,代码来源:devices.py

示例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 = []
开发者ID:Spacecraft-Code,项目名称:SPELL,代码行数:9,代码来源:resources.py

示例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")
开发者ID:unnch,项目名称:spell-sat,代码行数:9,代码来源:tc.py

示例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
开发者ID:Juniper,项目名称:contrail-controller,代码行数:10,代码来源:macvlan.py

示例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")
开发者ID:Spacecraft-Code,项目名称:SPELL,代码行数:11,代码来源:tm.py

示例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
开发者ID:netixx,项目名称:NetProbes,代码行数:12,代码来源:curses.py

示例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)
开发者ID:nonsns,项目名称:NetProbes,代码行数:18,代码来源:gui.py

示例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)
开发者ID:HackLinux,项目名称:HAsim-RV32I,代码行数:4,代码来源:vector.py

示例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")
开发者ID:Spacecraft-Code,项目名称:SPELL,代码行数:6,代码来源:usr.py

示例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")
开发者ID:Spacecraft-Code,项目名称:SPELL,代码行数:7,代码来源:memory.py

示例11: __init__

# 需要导入模块: from interface import Interface [as 别名]
# 或者: from interface.Interface import __init__ [as 别名]
 def __init__(self):
     Interface.__init__(self, "CONFIG")
     LOG("Created")
开发者ID:seciltabur,项目名称:spell-sat,代码行数:5,代码来源:config.py

示例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)
开发者ID:icoz,项目名称:python-udisks,代码行数:5,代码来源:device.py

示例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
开发者ID:Juniper,项目名称:contrail-controller,代码行数:8,代码来源:veth.py

示例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 = ""
开发者ID:netixx,项目名称:NetProbes,代码行数:6,代码来源:script.py

示例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
开发者ID:netixx,项目名称:NetProbes,代码行数:8,代码来源:cli.py


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