twisted_words.py 938 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. # Copyright (c) Twisted Matrix Laboratories.
  2. # See LICENSE for details.
  3. from zope.interface import provider
  4. from twisted.application.service import ServiceMaker
  5. from twisted.plugin import IPlugin
  6. from twisted.words import iwords
  7. NewTwistedWords = ServiceMaker(
  8. "New Twisted Words", "twisted.words.tap", "A modern words server", "words"
  9. )
  10. TwistedXMPPRouter = ServiceMaker(
  11. "XMPP Router", "twisted.words.xmpproutertap", "An XMPP Router server", "xmpp-router"
  12. )
  13. @provider(IPlugin, iwords.IProtocolPlugin)
  14. class RelayChatInterface:
  15. name = "irc"
  16. @classmethod
  17. def getFactory(cls, realm, portal):
  18. from twisted.words import service
  19. return service.IRCFactory(realm, portal)
  20. @provider(IPlugin, iwords.IProtocolPlugin)
  21. class PBChatInterface:
  22. name = "pb"
  23. @classmethod
  24. def getFactory(cls, realm, portal):
  25. from twisted.spread import pb
  26. return pb.PBServerFactory(portal, True)