a guest May 19th, 2017 44 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- # Copyright (c) 2001-2004 Twisted Matrix Laboratories.
- # See LICENSE for details.
- from twisted.internet import reactor, protocol
- from twisted.protocols.basic import LineReceiver
- #from pyroomba import *
- class RoombaPro(LineReceiver):
- """This is .... """
- #def __init__(self):
- #roomba = None
- def connectionMade(self):
- "Starting Roomba"
- #roomba = RoombaClassic(2)
- def lineReceived(self, data):
- "As soon as any data is received, write it back."
- print data
- def connectionLost(self, reason):
- "Stop Roomba"
- def sendSensors(self):
- return "Test"
- def main():
- """This runs the protocol on port 8000"""
- factory = protocol.ServerFactory()
- factory.protocol = RoombaPro
- reactor.listenTCP(8000, factory)
- # this only runs if the module was *not* imported
- if __name__ == '__main__':
RAW Paste Data