コード例 #1
0
ファイル: server.py プロジェクト: AnimatedRNG/HackHarvard2015
def commandReceived(command_string):
    if command_string == 'Disconnected':
        print('Disconnected')
        return
    if command_string == 'op':
        print('Show window!')
        util.show()
    elif command_string == 'cl':
        print('Attempting to minimize window')
        util.hide()
        renderer.resetAll()
    else:
        renderer.select(command_string)
コード例 #2
0
 def select(self, direction):
     new_node = self.currentNode
     new_node = self.nodeInDirection(new_node, direction)
     
     if new_node == None or not (direction in self.currentGesture):
         print('Bad choice')
         return;
     
     self.oldNodes.append(self.currentNode)
     self.currentNode = new_node;
     
     # Turn on flag for animation here
     
     self.currentGesture = self.currentGesture[direction]
     
     if not isinstance(self.currentGesture, dict):
         print('Running application: ' + self.currentGesture)
         #a = subprocess.Popen
         a = os.system
         start_new_thread(a, ("\"" + self.currentGesture + "\"",))            
         self.resetAll()
         util.hide()
         time.sleep(1)