Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(201)

Side by Side Diff: third_party/buildbot_7_12/buildbot/scripts/checkconfig.py

Issue 12207158: Bye bye buildbot 0.7.12. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 import sys
2 import os
3 from shutil import copy, rmtree
4 from tempfile import mkdtemp
5 from os.path import isfile
6 import traceback
7
8 from buildbot import master
9
10 class ConfigLoader(master.BuildMaster):
11 def __init__(self, basedir=os.getcwd(), configFileName="master.cfg"):
12 master.BuildMaster.__init__(self, basedir, configFileName)
13 configFileName = os.path.join(basedir, configFileName)
14 dir = os.getcwd()
15 # Use a temporary directory since loadConfig() creates a bunch of
16 # directories and compiles .py files
17 tempdir = mkdtemp()
18 try:
19 copy(configFileName, tempdir)
20 for entry in os.listdir("."):
21 # Any code in a subdirectory will _not_ be copied! This is a bug
22 if isfile(entry) and not entry.startswith("twistd.log"):
23 copy(entry, tempdir)
24 except:
25 raise
26
27 try:
28 os.chdir(tempdir)
29 # Add the temp directory to the library path so local modules work
30 sys.path.append(tempdir)
31 configFile = open(configFileName, "r")
32 self.loadConfig(configFile)
33 except:
34 os.chdir(dir)
35 configFile.close()
36 rmtree(tempdir)
37 raise
38 os.chdir(dir)
39 rmtree(tempdir)
OLDNEW
« no previous file with comments | « third_party/buildbot_7_12/buildbot/scripts/__init__.py ('k') | third_party/buildbot_7_12/buildbot/scripts/logwatcher.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698