title: Twisted - Python3 TypeError: __init__() missing 1 required positional argument: 'factory'
body: <p>I'm writing some python software that polls a modbus connection and stores the data in an SQL database. To see if the machine is working as a quick test, I'm making a simple console style "HMI" that you can telnet into. Here is the offending code, and error.</p>
  
  <pre><code>from twisted.internet.protocol import Protocol, Factory
  from twisted.internet.endpoints import TCP4ServerEndpoint
  from twisted.internet import reactor
  from twisted.internet import task
  from twisted.internet import protocol
  
  #from screenhelp import ScreenHelp ** Not relevant to error
  
  
  class Screen(Protocol):
  
      def __init__(self, factory):
          self.factory = factory
          self.connection = False
          self.loop = task.LoopingCall(screenRefresh)
          self.loopDeferred = None
          self.stack = []
          self.cs = ScreenHelp()
  
      def connectionMade(self):
          self.loopDeferred = self.loop.start(self,5)
  
      def connectionLost(self, reason):
          self.loop.stop(self)
  
      def dataReceived(self, data):
          self.stack.append(data)
  
      def screenRefresh(self):
  
          #self.transport.write(self.cs.clr()) ** Not relevent - issues clear screen command.
          for x in self.stack:
              self.transport.write(x)
  
  class ScreenFactory(Factory):
      def buildProtocol(self, addr):
          return Screen()
  
  
  def main():
      endpoint1 = TCP4ServerEndpoint(reactor, 64000)
      endpoint1.listen(ScreenFactory)
      reactor.listenTCP(5000, fact)
      reactor.run()
  
  
  if __name__ == "__main__":
       main()
  </code></pre>
  
  <p>The error is:</p>
  
  <pre><code>File "/usr/lib/python3/dist-packages/twisted/internet/protocol.py", line 135, in buildProtocol
      p = self.protocol()
  TypeError: __init__() missing 1 required positional argument: 'factory'
  </code></pre>
  
  <p>Thanks in advance for any help!</p>