-
Notifications
You must be signed in to change notification settings - Fork 0
/
Server.py
executable file
·45 lines (31 loc) · 956 Bytes
/
Server.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import sys
import Ice
Ice.loadSlice('Armory.ice')
import Armory
class PanTiltI(Armory.PanTilt):
def down(self, current=None):
print("going down...")
def up(self, current=None):
print("going up...")
def left(self, current=None):
print("going left...")
def right(self, current=None):
print("going right...")
def stop(self, current=None):
print("stopped...")
def fire(self, current=None):
print("fire!!!")
class Server(Ice.Application):
def run(self, argv):
broker = self.communicator()
servant = PanTiltI()
adapter = broker.createObjectAdapter("PanTiltAdapter")
proxy = adapter.add(servant, broker.stringToIdentity("turret"))
print(proxy)
sys.stdout.flush()
adapter.activate()
self.shutdownOnInterrupt()
broker.waitForShutdown()
return 0
server = Server()
sys.exit(server.main(sys.argv))