forked from robotika/eduro
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathraspi_dummy.py
More file actions
41 lines (30 loc) · 949 Bytes
/
raspi_dummy.py
File metadata and controls
41 lines (30 loc) · 949 Bytes
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
#!/usr/bin/python
"""
!!!DUMMY!! The main program of the comteticion Sick Robot Day 2014
"""
import sys
from SimpleXMLRPCServer import SimpleXMLRPCServer
from SimpleXMLRPCServer import SimpleXMLRPCRequestHandler
# Restrict to a particular path.
class RequestHandler(SimpleXMLRPCRequestHandler):
rpc_paths = ('/RPC2',)
class MyFuncs:
def init( self ):
return 1
def step( self ):
detected = [(1,2,3)] #['ahoj']
return detected
def term( self ):
return 1
if __name__ == "__main__":
if len(sys.argv) < 2:
print __doc__
sys.exit()
print "STARTED"
server = SimpleXMLRPCServer(("localhost", 8013),
requestHandler=RequestHandler)
server.register_introspection_functions()
server.register_instance(MyFuncs())
server.serve_forever()
#-------------------------------------------------------------------
# vim: expandtab sw=4 ts=4