Tweak to make python3 happy with our buildbot configuration
[blender-buildbot.git] / buildbot.tac
1
2 import os
3
4 from twisted.application import service
5 from buildbot.master import BuildMaster
6
7 basedir = r'.'
8 rotateLength = 10000000
9 maxRotatedFiles = 10
10 umask = 0o02
11
12 # if this is a relocatable tac file, get the directory containing the TAC
13 if basedir == '.':
14     import os.path
15     basedir = os.path.abspath(os.path.dirname(__file__))
16
17 # note: this line is matched against to check that this is a buildmaster
18 # directory; do not edit it.
19 application = service.Application('buildmaster')
20
21 try:
22   from twisted.python.logfile import LogFile
23   from twisted.python.log import ILogObserver, FileLogObserver
24   logfile = LogFile.fromFullPath(os.path.join(basedir, "twistd.log"), rotateLength=rotateLength,
25                                  maxRotatedFiles=maxRotatedFiles)
26   application.setComponent(ILogObserver, FileLogObserver(logfile).emit)
27 except ImportError:
28   # probably not yet twisted 8.2.0 and beyond, can't set log yet
29   pass
30
31 configfile = r'master.cfg'
32
33 m = BuildMaster(basedir, configfile)
34 m.setServiceParent(application)
35 m.log_rotation.rotateLength = rotateLength
36 m.log_rotation.maxRotatedFiles = maxRotatedFiles
37