twisted_words.py 1.0 KB

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