1 import sys
2 import os
3 from shutil import copy, rmtree
4 from tempfile import mkdtemp
5 from os.path import isfile
6
7 from buildbot import master
8
10 - def __init__(self, basedir=os.getcwd(), configFileName="master.cfg"):
11 master.BuildMaster.__init__(self, basedir, configFileName)
12 configFileName = os.path.join(basedir, configFileName)
13 dir = os.getcwd()
14
15
16 tempdir = mkdtemp()
17 try:
18 copy(configFileName, tempdir)
19 for entry in os.listdir("."):
20
21 if isfile(entry) and not entry.startswith("twistd.log"):
22 copy(entry, tempdir)
23 except:
24 raise
25
26 try:
27 os.chdir(tempdir)
28
29 sys.path.append(tempdir)
30 configFile = open(configFileName, "r")
31 self.loadConfig(configFile, check_synchronously_only=True)
32 except:
33 os.chdir(dir)
34 configFile.close()
35 rmtree(tempdir)
36 raise
37 os.chdir(dir)
38 rmtree(tempdir)
39