clenup fakerobot script

This commit is contained in:
Olivier R-D 2015-05-17 11:41:02 +02:00
parent d6f1408c2c
commit 54d6a312cf

View File

@ -41,12 +41,11 @@ class Server(socketserver.ThreadingMixIn, socketserver.TCPServer):
self.shutdown()
class FakeRobot(object):
if __name__ == "__main__":
# Port 0 means to select an arbitrary unused port
host, port = "localhost", 30002 # this is the standard secondary port for a UR robot
def run(self):
host = "localhost"
port = 30002
server = Server((host, port), RequestHandler)
server.init()
server_thread = threading.Thread(target=server.serve_forever)
@ -64,3 +63,11 @@ if __name__ == "__main__":
finally:
print("Shutting down server")
server.close()
if __name__ == "__main__":
r = FakeRobot()
r.run()