pep8 cleanup

This commit is contained in:
Campbell Barton 2011-03-27 05:23:14 +00:00
parent 7ccfec1ff3
commit 50a06eccff
13 changed files with 47 additions and 32 deletions

@ -1,6 +1,8 @@
# -*- python -*- # -*- python -*-
# ex: set syntax=python: # ex: set syntax=python:
# <pep8 compliant>
# Dictionary that the buildmaster pays attention to. # Dictionary that the buildmaster pays attention to.
c = BuildmasterConfig = {} c = BuildmasterConfig = {}
@ -36,12 +38,12 @@ c['change_source'] = SVNPoller(
# only take place on one slave. # only take place on one slave.
from buildbot.process.factory import BuildFactory 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 ShellCommand
from buildbot.steps.shell import Compile from buildbot.steps.shell import Compile
from buildbot.steps.shell import Test from buildbot.steps.shell import Test
from buildbot.steps.transfer import FileUpload from buildbot.steps.transfer import FileUpload
from buildbot.steps.transfer import FileDownload # from buildbot.steps.transfer import FileDownload
from buildbot.steps.master import MasterShellCommand from buildbot.steps.master import MasterShellCommand
from buildbot.config import BuilderConfig from buildbot.config import BuilderConfig
@ -50,6 +52,7 @@ from buildbot.config import BuilderConfig
c['builders'] = [] c['builders'] = []
buildernames = [] buildernames = []
def add_builder(c, name, libdir, factory): def add_builder(c, name, libdir, factory):
slavenames = [] slavenames = []
@ -64,15 +67,18 @@ def add_builder(c, name, libdir, factory):
# common steps # common steps
def svn_step(): 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): 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)
# generic builder # generic builder
def generic_builder(id, libdir=''):
def generic_builder(id, libdir=""):
filename = 'buildbot_upload_' + id + '.zip' filename = 'buildbot_upload_' + id + '.zip'
compile_script = '../blender/build_files/buildbot/slave_compile.py' compile_script = '../blender/build_files/buildbot/slave_compile.py'
test_script = '../blender/build_files/buildbot/slave_test.py' test_script = '../blender/build_files/buildbot/slave_test.py'
@ -88,9 +94,9 @@ def generic_builder(id, libdir=''):
f.addStep(Test(command=['python', test_script, id])) f.addStep(Test(command=['python', test_script, id]))
f.addStep(ShellCommand(name='package', command=['python', pack_script, id], description='packaging', descriptionDone='packaged')) f.addStep(ShellCommand(name='package', command=['python', pack_script, id], description='packaging', descriptionDone='packaged'))
if id.find('cmake') != -1: if id.find('cmake') != -1:
f.addStep(FileUpload(name='upload', slavesrc='buildbot_upload.zip', masterdest=filename, maxsize=100*1024*1024)) f.addStep(FileUpload(name='upload', slavesrc='buildbot_upload.zip', masterdest=filename, maxsize=100 * 1024 * 1024))
else: else:
f.addStep(FileUpload(name='upload', slavesrc='buildbot_upload.zip', masterdest=filename, maxsize=100*1024*1024, workdir='install')) f.addStep(FileUpload(name='upload', slavesrc='buildbot_upload.zip', masterdest=filename, maxsize=100 * 1024 * 1024, workdir='install'))
f.addStep(MasterShellCommand(name='unpack', command=['python', unpack_script, filename], description='unpacking', descriptionDone='unpacked')) f.addStep(MasterShellCommand(name='unpack', command=['python', unpack_script, filename], description='unpacking', descriptionDone='unpacked'))
return f return f
@ -107,7 +113,7 @@ add_builder(c, 'win32_scons', 'windows', generic_builder)
# #
# Decide how to react to incoming changes. # Decide how to react to incoming changes.
from buildbot.scheduler import Scheduler # from buildbot.scheduler import Scheduler
from buildbot.schedulers import timed from buildbot.schedulers import timed
c['schedulers'] = [] c['schedulers'] = []
@ -132,18 +138,18 @@ c['schedulers'].append(timed.Nightly(name='nightly',
c['status'] = [] c['status'] = []
from buildbot.status import html from buildbot.status import html
from buildbot.status.web import auth, authz from buildbot.status.web import authz
authz_cfg=authz.Authz( authz_cfg = authz.Authz(
# change any of these to True to enable; see the manual for more # change any of these to True to enable; see the manual for more
# options # options
gracefulShutdown = False, gracefulShutdown=False,
forceBuild = True, # use this to test your slave once it is set up forceBuild=True, # use this to test your slave once it is set up
forceAllBuilds = False, forceAllBuilds=False,
pingBuilder = False, pingBuilder=False,
stopBuild = False, stopBuild=False,
stopAllBuilds = False, stopAllBuilds=False,
cancelPendingBuild = False, cancelPendingBuild=False,
) )
c['status'].append(html.WebStatus(http_port=8010, authz=authz_cfg)) c['status'].append(html.WebStatus(http_port=8010, authz=authz_cfg))
@ -168,4 +174,3 @@ c['buildbotURL'] = "http://builder.blender.org/"
# installations. # installations.
c['db_url'] = "sqlite:///state.sqlite" c['db_url'] = "sqlite:///state.sqlite"

@ -19,6 +19,8 @@
# Runs on Buildbot master, to unpack incoming unload.zip into latest # Runs on Buildbot master, to unpack incoming unload.zip into latest
# builds directory and remove older builds. # builds directory and remove older builds.
# <pep8 compliant>
import os import os
import shutil import shutil
import sys import sys

@ -16,6 +16,8 @@
# #
# ##### END GPL LICENSE BLOCK ##### # ##### END GPL LICENSE BLOCK #####
# <pep8 compliant>
import os import os
import subprocess import subprocess
import sys import sys
@ -56,4 +58,3 @@ else:
retcode = subprocess.call(['python', 'scons/scons.py'] + scons_options) retcode = subprocess.call(['python', 'scons/scons.py'] + scons_options)
sys.exit(retcode) sys.exit(retcode)

@ -16,6 +16,8 @@
# #
# ##### END GPL LICENSE BLOCK ##### # ##### END GPL LICENSE BLOCK #####
# <pep8 compliant>
# Runs on buildbot slave, creating a release package using the build # Runs on buildbot slave, creating a release package using the build
# system and zipping it into buildbot_upload.zip. This is then uploaded # system and zipping it into buildbot_upload.zip. This is then uploaded
# to the master in the next buildbot step. # to the master in the next buildbot step.
@ -83,4 +85,3 @@ try:
except Exception, ex: except Exception, ex:
sys.stderr.write('Create buildbot_upload.zip failed' + str(ex) + '\n') sys.stderr.write('Create buildbot_upload.zip failed' + str(ex) + '\n')
sys.exit(1) sys.exit(1)

@ -16,7 +16,8 @@
# #
# ##### END GPL LICENSE BLOCK ##### # ##### END GPL LICENSE BLOCK #####
import os # <pep8 compliant>
import subprocess import subprocess
import sys import sys
@ -37,4 +38,3 @@ if builder.find('cmake') != -1:
else: else:
# scons # scons
pass pass

@ -126,7 +126,6 @@ def cmake_advanced_info():
defines = [] defines = []
import os import os
import sys
create_eclipse_project(CMAKE_DIR) create_eclipse_project(CMAKE_DIR)

@ -1,5 +1,7 @@
#!/usr/bin/python #!/usr/bin/python
# <pep8 compliant>
import os import os
import shutil import shutil
import subprocess import subprocess

@ -110,6 +110,7 @@ if _BPY_PROP_COLLECTION_FAKE:
else: else:
_BPY_PROP_COLLECTION_ID = "collection" _BPY_PROP_COLLECTION_ID = "collection"
def undocumented_message(module_name, type_name, identifier): def undocumented_message(module_name, type_name, identifier):
if str(type_name).startswith('<module'): if str(type_name).startswith('<module'):
preloadtitle = '%s.%s' % (module_name, identifier) preloadtitle = '%s.%s' % (module_name, identifier)

@ -27,10 +27,12 @@ The main function to use is: update_data_paths(...)
IS_TESTING = False IS_TESTING = False
def drepr(string): def drepr(string):
# is there a less crappy way to do this in python?, re.escape also escapes # is there a less crappy way to do this in python?, re.escape also escapes
# single quotes strings so cant use it. # single quotes strings so cant use it.
return '"%s"' % repr(string)[1:-1].replace("\"", "\\\"").replace("\\'","'") return '"%s"' % repr(string)[1:-1].replace("\"", "\\\"").replace("\\'", "'")
class DataPathBuilder(object): class DataPathBuilder(object):
__slots__ = ("data_path", ) __slots__ = ("data_path", )
@ -185,7 +187,7 @@ def update_data_paths(rna_update):
if data_path_new != data_path: if data_path_new != data_path:
if not IS_TESTING: if not IS_TESTING:
fcurve.data_path = data_path_new fcurve.data_path = data_path_new
fcurve.driver.is_valid = True; # reset to allow this to work again fcurve.driver.is_valid = True # reset to allow this to work again
print("driver-fcurve (%s): %s -> %s" % (id_data.name, data_path, data_path_new)) print("driver-fcurve (%s): %s -> %s" % (id_data.name, data_path, data_path_new))
for var in fcurve.driver.variables: for var in fcurve.driver.variables:

@ -160,9 +160,9 @@ if __name__ == "__main__":
from bpyml_test import * from bpyml_test import *
draw = [ draw = [
ui() [ ui()[
split() [ split()[
column() [ column()[
prop(data='context.scene.render', property='use_stamp_time', text='Time'), prop(data='context.scene.render', property='use_stamp_time', text='Time'),
prop(data='context.scene.render', property='use_stamp_date', text='Date'), prop(data='context.scene.render', property='use_stamp_date', text='Date'),
prop(data='context.scene.render', property='use_stamp_render_time', text='RenderTime'), prop(data='context.scene.render', property='use_stamp_render_time', text='RenderTime'),
@ -173,7 +173,7 @@ if __name__ == "__main__":
prop(data='context.scene.render', property='use_stamp_marker', text='Marker'), prop(data='context.scene.render', property='use_stamp_marker', text='Marker'),
prop(data='context.scene.render', property='use_stamp_sequencer_strip', text='Seq. Strip') prop(data='context.scene.render', property='use_stamp_sequencer_strip', text='Seq. Strip')
], ],
column() [ column()[
active(expr='context.scene.render.use_stamp'), active(expr='context.scene.render.use_stamp'),
prop(data='context.scene.render', property='stamp_foreground', slider=True), prop(data='context.scene.render', property='stamp_foreground', slider=True),
prop(data='context.scene.render', property='stamp_background', slider=True), prop(data='context.scene.render', property='stamp_background', slider=True),
@ -181,9 +181,9 @@ if __name__ == "__main__":
prop(data='context.scene.render', property='stamp_font_size', text='Font Size') prop(data='context.scene.render', property='stamp_font_size', text='Font Size')
] ]
], ],
split(percentage=0.2) [ split(percentage=0.2)[
prop(data='context.scene.render', property='use_stamp_note', text='Note'), prop(data='context.scene.render', property='use_stamp_note', text='Note'),
row() [ row()[
active(expr='context.scene.render.use_stamp_note'), active(expr='context.scene.render.use_stamp_note'),
prop(data='context.scene.render', property='stamp_note_text', text='') prop(data='context.scene.render', property='stamp_note_text', text='')
] ]

@ -20,6 +20,7 @@
import bpy import bpy
from rna_prop_ui import PropertyPanel from rna_prop_ui import PropertyPanel
class ArmatureButtonsPanel(): class ArmatureButtonsPanel():
bl_space_type = 'PROPERTIES' bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW' bl_region_type = 'WINDOW'
@ -264,6 +265,7 @@ from bl_ui.properties_animviz import (
OnionSkinButtonsPanel, OnionSkinButtonsPanel,
) )
class DATA_PT_motion_paths(MotionPathButtonsPanel, bpy.types.Panel): class DATA_PT_motion_paths(MotionPathButtonsPanel, bpy.types.Panel):
#bl_label = "Bones Motion Paths" #bl_label = "Bones Motion Paths"
bl_context = "data" bl_context = "data"

@ -1161,8 +1161,8 @@ class VIEW3D_MT_pose(bpy.types.Menu):
layout.menu("VIEW3D_MT_transform") layout.menu("VIEW3D_MT_transform")
layout.menu("VIEW3D_MT_pose_transform") layout.menu("VIEW3D_MT_pose_transform")
layout.menu("VIEW3D_MT_pose_apply") layout.menu("VIEW3D_MT_pose_apply")
layout.menu("VIEW3D_MT_snap") layout.menu("VIEW3D_MT_snap")
layout.separator() layout.separator()

@ -42,7 +42,7 @@ SKIP_PREFIX = "./tools", "./config", "./scons", "./extern"
def file_list_py(path): def file_list_py(path):
for dirpath, dirnames, filenames in os.walk(path): for dirpath, dirnames, filenames in os.walk(path):
for filename in filenames: for filename in filenames:
if filename.endswith(".py"): if filename.endswith(".py") or filename.endswith(".cfg"):
yield os.path.join(dirpath, filename) yield os.path.join(dirpath, filename)