forked from tsing/doubanbot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dbb.tac
executable file
·29 lines (23 loc) · 923 Bytes
/
dbb.tac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import sys
sys.path.append("lib")
import commands
from twisted.application import service
from twisted.internet import task, reactor
from twisted.words.protocols.jabber import jid
from wokkel.client import XMPPClient
from wokkel.generic import VersionHandler
from doubanbot import config
from doubanbot import protocol
from doubanbot import scheduling
from doubanbot import doubanapi
doubanapi.API_KEY = config.API_KEY
doubanapi.API_SECRET = config.API_SECRET
application = service.Application(config.NAME)
xmppclient = XMPPClient(jid.internJID(config.SCREEN_NAME), config.CONF.get('xmpp', 'pass'))
xmppclient.logTraffic = False
doubanBot=protocol.DoubanBotProtocol()
doubanBot.setHandlerParent(xmppclient)
VERSION = commands.getoutput("git describe").strip()
VersionHandler(config.NAME, VERSION).setHandlerParent(xmppclient)
protocol.KeepAlive().setHandlerParent(xmppclient)
xmppclient.setServiceParent(application)