當前位置: 首頁>>代碼示例>>Python>>正文


Python System.__init__方法代碼示例

本文整理匯總了Python中system.System.__init__方法的典型用法代碼示例。如果您正苦於以下問題:Python System.__init__方法的具體用法?Python System.__init__怎麽用?Python System.__init__使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在system.System的用法示例。


在下文中一共展示了System.__init__方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

# 需要導入模塊: from system import System [as 別名]
# 或者: from system.System import __init__ [as 別名]
    def __init__(self):
        global _requests

        self.camip = "sonycam.msgroup.ucla.edu"
        self.ourip = socket.gethostbyaddr(socket.gethostname())[-1][0]
        self.port = 9218
        self.camtool = "./camctrl"
        self.pan=0
        self.tilt=0
        self.zoom=0
        self.setCam()
        
        print "Start parsing xml file"
        espmlFile = 'sonyCamSystem.xml'
        espmlDocObject = espml.parse(espmlFile)
        systemElement = espmlDocObject.getSystem()
        systemElement.setId('http://'+str(self.ourip)+':'+self.port)
        espmlDocObject.export(file(espmlFile, 'w'), 0)
        
        System.__init__(self, self.port, "http://128.97.93.5:1718/", "sonyCamSystem.xml")
        print "Registered system"
        

        #the next call is blocking!
        print "starting..."
        self.start()
        
        raw_input("Press a key when done")
開發者ID:nesl,項目名稱:esp,代碼行數:30,代碼來源:sonyCamSystem.py

示例2: __init__

# 需要導入模塊: from system import System [as 別名]
# 或者: from system.System import __init__ [as 別名]
    def __init__(self, engine):
        """Constructor"""
        System.__init__(self, engine)
        ogre.FrameListener.__init__(self)
        ogre.WindowEventListener.__init__(self)
        OIS.KeyListener.__init__(self)
        OIS.MouseListener.__init__(self)
        OIS.JoyStickListener.__init__(self)

        self.handlers = [dict() for x in range(InputEvent.NUM)]
        self.mouse_handlers = [dict() for x in range(MouseEvent.NUM)]
        self.joy_handlers = [dict() for x in range(JoyEvent.NUM)]
        self.key_states = {}
        self.keys_down = list()
        self.mouse_buttons_down = {}
        self.mouse_down_pos = {}
        self.mouse_down_over = {}
        self.mouse_down_modifiers = {}
        self.input_locks = {}
        for mb in MouseButton.LIST:
            self.mouse_buttons_down[mb] = False
            self.mouse_down_pos[mb] = None
            self.mouse_down_over[mb] = None
            self.mouse_down_modifiers[mb] = [False for x in range(Modifier.NUM)]
            self.input_locks[mb] = InputLock()
        self.mouse_state = None

        #box selection
        #self.selection_dd_context = self.engine.debugDrawSystem.getContext()
        #self.boxSelection = None
        #self.maintainDDContext = self.engine.debugDrawSystem.getContext()
        self.translation_to_apply = vector3(0,0,0)

        self.translation_to_apply_time_left = 0
開發者ID:kyphelps,項目名稱:pynecraft,代碼行數:36,代碼來源:input_system.py

示例3: __init__

# 需要導入模塊: from system import System [as 別名]
# 或者: from system.System import __init__ [as 別名]
    def __init__(self):
        global _requests

        System.__init__(self, 8081, "http://128.97.93.154:8080/", "sos_system.xml")
        # start the SOAP server
        
        self.sossrvClient = sossrv_tools.SossrvClient()

        _requests = {'field_getCurrent': {},
                     'field_average': {},
                     'sensor_getCurrentValue': {},
                     'sensor_getAverageValue': {}
                     }

        self.sensorModule = SensorModule()
        self.sossrvClient.register_module(self.sensorModule)
        # connect to the sossrv application
        self.sossrvClient.connect()

        SocketServer.TCPServer.__init__(self, ('128.97.93.154', 8082) , ESPRequestHandler)
        esphttpserver = thread.start_new_thread(self.serve_forever, ())

        #the next call is blocking!
        print "starting..."
        self.start()
        
        raw_input("Press a key when done")
開發者ID:nesl,項目名稱:esp,代碼行數:29,代碼來源:basestation.py

示例4: __init__

# 需要導入模塊: from system import System [as 別名]
# 或者: from system.System import __init__ [as 別名]
    def __init__(self):
        global _requests

        System.__init__(self, 7081, "http://128.97.93.154:8080/", "soundscape_system.xml")

        #the next call is blocking!
        print "starting..."
        self.start()
        
        raw_input("Press a key when done")
開發者ID:nesl,項目名稱:esp,代碼行數:12,代碼來源:soundscape.py

示例5: __init__

# 需要導入模塊: from system import System [as 別名]
# 或者: from system.System import __init__ [as 別名]
    def __init__(self):
        global _requests

        System.__init__(self, 7082, "128.97.93.5:1817", "sensorbase_system.xml")

        #the next call is blocking!
        print "starting..."
        self.start()
        
        raw_input("Press a key when done")
開發者ID:nesl,項目名稱:esp,代碼行數:12,代碼來源:sensorbase.py

示例6: __init__

# 需要導入模塊: from system import System [as 別名]
# 或者: from system.System import __init__ [as 別名]
    def __init__(self):
        global _requests

        print "Start parsing xml file"
        System.__init__(self, 9181, "http://128.97.93.154:8080/", "beachCamSystem.xml")
        print "Registered system"
        

        #the next call is blocking!
        print "starting..."
        self.start()
        
        raw_input("Press a key when done")
開發者ID:nesl,項目名稱:esp,代碼行數:15,代碼來源:beachCamSystem.py

示例7: __init__

# 需要導入模塊: from system import System [as 別名]
# 或者: from system.System import __init__ [as 別名]
    def __init__(self):
        global _requests

        print "Start parsing xml file"
        System.__init__(self, 8081, "http://127.0.0.1:8080/", "iTunesSystem.xml")
        print "Registered system"
        

        #the next call is blocking!
        print "starting..."
        self.start()
        
        raw_input("Press a key when done")
開發者ID:nesl,項目名稱:esp,代碼行數:15,代碼來源:iTunesSystem.py

示例8: __init__

# 需要導入模塊: from system import System [as 別名]
# 或者: from system.System import __init__ [as 別名]
    def __init__(self):
        global _requests

        print "Start parsing xml file"
        System.__init__(self, 9081, "http://128.97.93.154:8080/", "weatherSystem.xml")
        print "Registered system"
        
        # start the SOAP server
        
        SocketServer.TCPServer.__init__(self, ('128.97.93.154', 9082) , ESPRequestHandler)
        esphttpserver = thread.start_new_thread(self.serve_forever, ())

        #the next call is blocking!
        print "starting..."
        self.start()
        
        raw_input("Press a key when done")
開發者ID:nesl,項目名稱:esp,代碼行數:19,代碼來源:weatherSystem.py


注:本文中的system.System.__init__方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。