forked from iffy/simplebb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sample_tac
41 lines (27 loc) · 1.34 KB
/
sample_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
29
30
31
32
33
34
35
36
37
38
39
from twisted.internet import reactor, task, utils
from twisted.application import service, internet
from twisted.python.logfile import LogFile
from twisted.python.log import ILogObserver, FileLogObserver
application = service.Application("simplebb")
from simplebb.main import Glue
g = Glue()
#------------------------------------------------------------------------------
# local build steps
#------------------------------------------------------------------------------
g.addProjectRoot('~/.simplebb/buildscripts')
#------------------------------------------------------------------------------
# telnet access
#------------------------------------------------------------------------------
g.startTelnetShell(8007)
#------------------------------------------------------------------------------
# logging
#------------------------------------------------------------------------------
rotateLength = 1000000
maxRotatedFiles = 5
logfile = LogFile.fromFullPath("simplebb.log", rotateLength=rotateLength,
maxRotatedFiles=maxRotatedFiles)
application.setComponent(ILogObserver, FileLogObserver(logfile).emit)
#------------------------------------------------------------------------------
# hook up the services
#------------------------------------------------------------------------------
g.useApplication(application)