Initial import to Tizen
[profile/ivi/python-twisted.git] / twisted / plugins / twisted_words.py
1 # Copyright (c) Twisted Matrix Laboratories.
2 # See LICENSE for details.
3
4 from zope.interface import classProvides
5
6 from twisted.plugin import IPlugin
7
8 from twisted.application.service import ServiceMaker
9 from twisted.words import iwords
10
11
12 NewTwistedWords = ServiceMaker(
13     "New Twisted Words",
14     "twisted.words.tap",
15     "A modern words server",
16     "words")
17
18 TwistedXMPPRouter = ServiceMaker(
19     "XMPP Router",
20     "twisted.words.xmpproutertap",
21     "An XMPP Router server",
22     "xmpp-router")
23
24 class RelayChatInterface(object):
25     classProvides(IPlugin, iwords.IProtocolPlugin)
26
27     name = 'irc'
28
29     def getFactory(cls, realm, portal):
30         from twisted.words import service
31         return service.IRCFactory(realm, portal)
32     getFactory = classmethod(getFactory)
33
34 class PBChatInterface(object):
35     classProvides(IPlugin, iwords.IProtocolPlugin)
36
37     name = 'pb'
38
39     def getFactory(cls, realm, portal):
40         from twisted.spread import pb
41         return pb.PBServerFactory(portal, True)
42     getFactory = classmethod(getFactory)
43