Revision: 35675
          
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=35675
Author:   campbellbarton
Date:     2011-03-21 22:37:08 +0000 (Mon, 21 Mar 2011)
Log Message:
-----------
use spaces rather then tabs + minor pep8 edits.

Modified Paths:
--------------
    trunk/blender/build_files/buildbot/master.cfg
    trunk/blender/build_files/buildbot/master_unpack.py
    trunk/blender/build_files/buildbot/slave_pack.py

Modified: trunk/blender/build_files/buildbot/master.cfg
===================================================================
--- trunk/blender/build_files/buildbot/master.cfg       2011-03-21 22:17:01 UTC 
(rev 35674)
+++ trunk/blender/build_files/buildbot/master.cfg       2011-03-21 22:37:08 UTC 
(rev 35675)
@@ -15,7 +15,7 @@
 c['slaves'] = []
 
 for slave in master_private.slaves:
-       c['slaves'].append(BuildSlave(slave['name'], slave['password']))
+    c['slaves'].append(BuildSlave(slave['name'], slave['password']))
 
 # TCP port through which slaves connect
 
@@ -36,7 +36,7 @@
 # only take place on one slave.
 
 from buildbot.process.factory import BuildFactory
-from buildbot.steps.source import SVN 
+from buildbot.steps.source import SVN
 from buildbot.steps.shell import ShellCommand
 from buildbot.steps.shell import Compile
 from buildbot.steps.shell import Test
@@ -50,88 +50,100 @@
 c['builders'] = []
 buildernames = []
 
+
 def add_builder(c, name, factory):
-       slavenames = []
+    slavenames = []
 
-       for slave in master_private.slaves:
-               if name in slave['builders']:
-                       slavenames.append(slave['name'])
-       
-       f = factory(name)
-       c['builders'].append(BuilderConfig(name=name, slavenames=slavenames, 
factory=f, category='blender'))
-       buildernames.append(name)
+    for slave in master_private.slaves:
+        if name in slave['builders']:
+            slavenames.append(slave['name'])
 
+    f = factory(name)
+    c['builders'].append(BuilderConfig(name=name, slavenames=slavenames, 
factory=f, category='blender'))
+    buildernames.append(name)
+
 # common steps
 
+
 def svn_step():
-       return 
SVN(baseURL='https://svn.blender.org/svnroot/bf-blender/%%BRANCH%%/blender', 
mode='update', defaultBranch='trunk', workdir='blender')
+    return 
SVN(baseURL='https://svn.blender.org/svnroot/bf-blender/%%BRANCH%%/blender', 
mode='update', defaultBranch='trunk', workdir='blender')
 
+
 def lib_svn_step(dir):
-       return SVN(name='lib svn', 
baseURL='https://svn.blender.org/svnroot/bf-blender/%%BRANCH%%/lib/' + dir, 
mode='update', defaultBranch='trunk', workdir='lib/' + dir)
+    return SVN(name='lib svn', 
baseURL='https://svn.blender.org/svnroot/bf-blender/%%BRANCH%%/lib/' + dir, 
mode='update', defaultBranch='trunk', workdir='lib/' + dir)
 
+
 def cmake_compile_step():
-       return Compile(command=['make'], workdir='blender')
+    return Compile(command=['make'], workdir='blender')
 
+
 def cmake_test_step():
-       return Test(workdir='blender') # make test
+    return Test(workdir='blender')  # make test
 
+
 def scons_compile_step():
-       return Compile(command=['python', 'scons/scons.py'], workdir='blender')
+    return Compile(command=['python', 'scons/scons.py'], workdir='blender')
 
+
 class SlavePack(ShellCommand):
-       pack_script = 'slave_pack.py'
-       def start(self):
-               if self.getProperty('buildername').find('scons')>=0:
-                       self.setCommand(['python', pack_script, 'scons'])
-               else:
-                       self.setCommand(['python', pack_script, 'cmake'])
-               ShellCommand.start(self)
+    pack_script = 'slave_pack.py'
 
+    def start(self):
+        if self.getProperty('buildername').find('scons') >= 0:
+            self.setCommand(['python', pack_script, 'scons'])
+        else:
+            self.setCommand(['python', pack_script, 'cmake'])
+        ShellCommand.start(self)
+
+
 def file_upload(f, id):
-       filename = 'buildbot_upload_' + id + '.zip'
-       pack_script = 'slave_pack.py'
-       unpack_script = 'master_unpack.py'
+    filename = 'buildbot_upload_' + id + '.zip'
+    pack_script = 'slave_pack.py'
+    unpack_script = 'master_unpack.py'
 
-       f.addStep(FileDownload(name='download', mastersrc=pack_script, 
slavedest=pack_script))
-       f.addStep(ShellCommand(name='package', command=['python', pack_script], 
description='packaging', descriptionDone='packaged'))
-       f.addStep(FileUpload(name='upload', slavesrc='buildbot_upload.zip', 
masterdest=filename, maxsize=100*1024*1024))
-       f.addStep(MasterShellCommand(name='unpack', command=['python', 
unpack_script, filename], description='unpacking', descriptionDone='unpacked'))
+    f.addStep(FileDownload(name='download', mastersrc=pack_script, 
slavedest=pack_script))
+    f.addStep(ShellCommand(name='package', command=['python', pack_script], 
description='packaging', descriptionDone='packaged'))
+    f.addStep(FileUpload(name='upload', slavesrc='buildbot_upload.zip', 
masterdest=filename, maxsize=100 * 1024 * 1024))
+    f.addStep(MasterShellCommand(name='unpack', command=['python', 
unpack_script, filename], description='unpacking', descriptionDone='unpacked'))
 
 # linux cmake
 
+
 def linux_cmake(id):
-       f = BuildFactory()
-       f.addStep(svn_step())
-       f.addStep(cmake_compile_step())
-       f.addStep(cmake_test_step())
-       file_upload(f, id)
-       return f
+    f = BuildFactory()
+    f.addStep(svn_step())
+    f.addStep(cmake_compile_step())
+    f.addStep(cmake_test_step())
+    file_upload(f, id)
+    return f
 
 add_builder(c, 'linux_x86_64_cmake', linux_cmake)
 
 # mac cmake
 
+
 def mac_cmake(id):
-       f = BuildFactory()
-       f.addStep(svn_step())
-       f.addStep(lib_svn_step('darwin-9.x.universal'))
-       f.addStep(cmake_compile_step())
-       f.addStep(cmake_test_step())
-       file_upload(f, id)
-       return f
+    f = BuildFactory()
+    f.addStep(svn_step())
+    f.addStep(lib_svn_step('darwin-9.x.universal'))
+    f.addStep(cmake_compile_step())
+    f.addStep(cmake_test_step())
+    file_upload(f, id)
+    return f
 
 add_builder(c, 'mac_x86_64_cmake', mac_cmake)
 
 # win32 scons
 
+
 # TODO: add scons test target
 def win32_scons(id):
-       f = BuildFactory()
-       f.addStep(svn_step())
-       f.addStep(lib_svn_step('windows'))
-       f.addStep(scons_compile_step())
-       file_upload(f, id)
-       return f
+    f = BuildFactory()
+    f.addStep(svn_step())
+    f.addStep(lib_svn_step('windows'))
+    f.addStep(scons_compile_step())
+    file_upload(f, id)
+    return f
 
 add_builder(c, 'win32_scons', win32_scons)
 
@@ -147,8 +159,8 @@
 #                                 treeStableTimer=None,
 #                                 builderNames=[]))
 #c['schedulers'].append(timed.Periodic(name="nightly",
-#                                              builderNames=buildernames,
-#                                              periodicBuildTimer=24*60*60))
+#                        builderNames=buildernames,
+#                        periodicBuildTimer=24*60*60))
 
 c['schedulers'].append(timed.Nightly(name='nightly',
     builderNames=buildernames,
@@ -166,16 +178,16 @@
 from buildbot.status import html
 from buildbot.status.web import auth, authz
 
-authz_cfg=authz.Authz(
+authz_cfg = authz.Authz(
     # change any of these to True to enable; see the manual for more
     # options
-    gracefulShutdown = False,
-    forceBuild = True, # use this to test your slave once it is set up
-    forceAllBuilds = False,
-    pingBuilder = False,
-    stopBuild = False,
-    stopAllBuilds = False,
-    cancelPendingBuild = False,
+    gracefulShutdown=False,
+    forceBuild=True,  # use this to test your slave once it is set up
+    forceAllBuilds=False,
+    pingBuilder=False,
+    stopBuild=False,
+    stopAllBuilds=False,
+    cancelPendingBuild=False,
 )
 
 c['status'].append(html.WebStatus(http_port=8010, authz=authz_cfg))
@@ -200,4 +212,3 @@
 # installations.
 
 c['db_url'] = "sqlite:///state.sqlite"
-

Modified: trunk/blender/build_files/buildbot/master_unpack.py
===================================================================
--- trunk/blender/build_files/buildbot/master_unpack.py 2011-03-21 22:17:01 UTC 
(rev 35674)
+++ trunk/blender/build_files/buildbot/master_unpack.py 2011-03-21 22:37:08 UTC 
(rev 35675)
@@ -18,67 +18,69 @@
 
 # Runs on Buildbot master, to unpack incoming unload.zip into latest
 # builds directory and remove older builds.
- 
+
 import os
 import shutil
 import sys
 import zipfile
 
+
 # extension stripping
 def strip_extension(filename):
-       extensions = ['.zip', '.tar', '.bz2', '.gz', '.tgz', '.tbz', '.exe']
+    extensions = ['.zip', '.tar', '.bz2', '.gz', '.tgz', '.tbz', '.exe']
 
-       for ext in extensions:
-               if filename.endswith(ext):
-                       filename = filename[:-len(ext)]
+    for ext in extensions:
+        if filename.endswith(ext):
+            filename = filename[:-len(ext)]
 
-       return filename
+    return filename
 
+
 # extract platform from package name
 def get_platform(filename):
-       # name is blender-version-platform.extension. we want to get the
-       # platform out, but there may be some variations, so we fiddle a
-       # bit to handle current and hopefully future names
-       filename = strip_extension(filename)
-       filename = strip_extension(filename)
+    # name is blender-version-platform.extension. we want to get the
+    # platform out, but there may be some variations, so we fiddle a
+    # bit to handle current and hopefully future names
+    filename = strip_extension(filename)
+    filename = strip_extension(filename)
 
-       tokens = filename.split("-")
-       platforms = ['osx', 'mac', 'bsd', 'windows', 'linux', 'source', 'irix', 
'solaris']
-       platform_tokens = []
-       found = False
+    tokens = filename.split("-")
+    platforms = ['osx', 'mac', 'bsd', 'windows', 'linux', 'source', 'irix', 
'solaris']
+    platform_tokens = []
+    found = False
 
-       for i, token in enumerate(tokens):
-               if not found:
-                       for platform in platforms:
-                               if token.lower().find(platform) != -1:
-                                       found = True
+    for i, token in enumerate(tokens):
+        if not found:
+            for platform in platforms:
+                if token.lower().find(platform) != -1:
+                    found = True
 
-               if found:
-                       platform_tokens += [token]
+        if found:
+            platform_tokens += [token]
 
-       return '-'.join(platform_tokens)
+    return '-'.join(platform_tokens)
 
 # get filename
 if len(sys.argv) < 2:
-       sys.stderr.write("Not enough arguments, expecting file to unpack\n")
-       sys.exit(1)
+    sys.stderr.write("Not enough arguments, expecting file to unpack\n")
+    sys.exit(1)
 
 filename = sys.argv[1]
 
 # open zip file
 if not os.path.exists(filename):
-       sys.stderr.write("File " + filename + " not found.\n")
-       sys.exit(1)
+    sys.stderr.write("File " + filename + " not found.\n")
+    sys.exit(1)
 
 try:
-       z = zipfile.ZipFile(filename, "r")
+    z = zipfile.ZipFile(filename, "r")
 except Exception, ex:
-       sys.stderr.write('Failed to open zip file: ' + str(ex) + '\n')
-       sys.exit(1)
+    sys.stderr.write('Failed to open zip file: ' + str(ex) + '\n')
+    sys.exit(1)
 
 if len(z.namelist()) != 1:
-       sys.stderr.write("Expected on file in " + filename + ".")
-       sys.exit(1)
+    sys.stderr.write("Expected on file in " + filename + ".")
+    sys.exit(1)
 
 package = z.namelist()[0]

@@ Diff output truncated at 10240 characters. @@
_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to