pep8 update & some minor cmake edits.

This commit is contained in:
Campbell Barton 2011-09-20 18:29:19 +00:00
parent 0af633a36c
commit 8f5112f191
29 changed files with 47 additions and 32 deletions

@ -52,7 +52,7 @@ def get_platform(filename):
platform_tokens = []
found = False
for i, token in enumerate(tokens):
for token in tokens:
if not found:
for platform in platforms:
if platform in token.lower():

@ -43,6 +43,7 @@ CHECKER_ARGS = [
# "--enable=all", # if you want sixty hundred pedantic suggestions
]
def main():
source_info = project_source_info.build_info(ignore_prefix_list=CHECKER_IGNORE_PREFIX)
@ -58,12 +59,12 @@ def main():
check_commands.append((c, cmd))
for i, (c, cmd) in enumerate(check_commands):
percent = 100.0 * (i / (len(check_commands)-1))
percent = 100.0 * (i / (len(check_commands) - 1))
percent_str = "[" + ("%.2f]" % percent).rjust(7) + " %:"
# if percent < 27.9:
# continue
# let cppcheck finish the line off...
sys.stdout.write("%s " % percent_str)

@ -58,9 +58,9 @@ CHECKER_ARGS = [
# re-definitions, rna causes most of these
"-redef",
"-syntax",
# dummy, witjout this splint complains with:
# /usr/include/bits/confname.h:31:27: *** Internal Bug at cscannerHelp.c:2428: Unexpanded macro not function or constant: int _PC_MAX_CANON
# /usr/include/bits/confname.h:31:27: *** Internal Bug at cscannerHelp.c:2428: Unexpanded macro not function or constant: int _PC_MAX_CANON
"-D_PC_MAX_CANON=0",
]

@ -27,7 +27,6 @@ __all__ = (
)
import os
import sys
from os.path import join, dirname, normpath, abspath
SOURCE_DIR = join(dirname(__file__), "..", "..")
@ -35,11 +34,6 @@ SOURCE_DIR = normpath(SOURCE_DIR)
SOURCE_DIR = abspath(SOURCE_DIR)
def is_c_header(filename):
ext = os.path.splitext(filename)[1]
return (ext in (".h", ".hpp", ".hxx"))
def is_c_header(filename):
ext = os.path.splitext(filename)[1]
return (ext in (".h", ".hpp", ".hxx"))
@ -79,6 +73,7 @@ def do_ignore(filepath, ignore_prefix_list):
def makefile_log():
import subprocess
import time
# Check blender is not 2.5x until it supports playback again
print("running make with --dry-run ...")
process = subprocess.Popen(["make", "--always-make", "--dry-run", "--keep-going", "VERBOSE=1"],

@ -765,7 +765,7 @@ def pyrna2sphinx(BASEPATH):
fw(" .. attribute:: %s\n\n" % prop.identifier)
if prop.description:
fw(" %s\n\n" % prop.description)
# special exception, cant use genric code here for enums
if prop.type == "enum":
enum_text = pyrna_enum2sphinx(prop)

@ -67,6 +67,7 @@ set(SRC
FX/AUD_SuperposeFactory.cpp
FX/AUD_SuperposeReader.cpp
FX/AUD_VolumeFactory.cpp
intern/AUD_3DMath.h
intern/AUD_AnimateableProperty.cpp
intern/AUD_AnimateableProperty.h
@ -99,6 +100,7 @@ set(SRC
intern/AUD_IWriter.h
intern/AUD_JOSResampleFactory.cpp
intern/AUD_JOSResampleFactory.h
intern/AUD_JOSResampleReaderCoeff.cpp
intern/AUD_JOSResampleReader.cpp
intern/AUD_JOSResampleReader.h
intern/AUD_LinearResampleFactory.cpp

@ -25,6 +25,7 @@
# dont register these classes since they are only helpers.
from blf import gettext as _
class MotionPathButtonsPanel():
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'

@ -22,6 +22,7 @@ from bpy.types import Panel, Menu
from rna_prop_ui import PropertyPanel
from blf import gettext as _
class ArmatureButtonsPanel():
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'

@ -23,6 +23,7 @@ from bpy.types import Panel
from rna_prop_ui import PropertyPanel
from blf import gettext as _
class BoneButtonsPanel():
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'

@ -22,6 +22,7 @@ from bpy.types import Panel
from rna_prop_ui import PropertyPanel
from blf import gettext as _
class CameraButtonsPanel():
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'

@ -22,6 +22,7 @@ from bpy.types import Panel
from rna_prop_ui import PropertyPanel
from blf import gettext as _
class CurveButtonsPanel():
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'

@ -21,6 +21,7 @@ import bpy
from bpy.types import Panel
from blf import gettext as _
class DataButtonsPanel():
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'

@ -22,6 +22,7 @@ from bpy.types import Menu, Panel
from rna_prop_ui import PropertyPanel
from blf import gettext as _
class LAMP_MT_sunsky_presets(Menu):
bl_label = _("Sun & Sky Presets")
preset_subdir = "sunsky"

@ -22,6 +22,7 @@ from bpy.types import Menu, Panel
from rna_prop_ui import PropertyPanel
from blf import gettext as _
class MESH_MT_vertex_group_specials(Menu):
bl_label = _("Vertex Group Specials")
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}

@ -22,6 +22,7 @@ from bpy.types import Panel
from rna_prop_ui import PropertyPanel
from blf import gettext as _
class DataButtonsPanel():
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'

@ -21,6 +21,7 @@ import bpy
from bpy.types import Panel
from blf import gettext as _
class ModifierButtonsPanel():
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
@ -203,7 +204,7 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
def DECIMATE(self, layout, ob, md):
layout.prop(md, "ratio")
layout.label(text=_("Face Count")+": %s" % str(md.face_count))
layout.label(text=_("Face Count") + ": %d" % md.face_count)
def DISPLACE(self, layout, ob, md):
split = layout.split()

@ -21,6 +21,7 @@ import bpy
from bpy.types import Panel
from blf import gettext as _
class PhysicsButtonsPanel():
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'

@ -22,6 +22,7 @@ from bpy.types import Menu, Panel
from rna_prop_ui import PropertyPanel
from blf import gettext as _
def active_node_mat(mat):
# TODO, 2.4x has a pipeline section, for 2.5 we need to communicate
# which settings from node-materials are used
@ -618,7 +619,7 @@ class MATERIAL_PT_game_settings(MaterialButtonsPanel, bpy.types.Panel):
@classmethod
def poll(cls, context):
return context.material and (context.scene.render.engine in cls.COMPAT_ENGINES)
return context.material and (context.scene.render.engine in cls.COMPAT_ENGINES)
def draw(self, context):
layout = self.layout
@ -633,13 +634,14 @@ class MATERIAL_PT_game_settings(MaterialButtonsPanel, bpy.types.Panel):
row.label(text="Alpha Blend:")
row.label(text="Face Orientation:")
row = layout.row()
row.prop(game,"alpha_blend",text="")
row.prop(game,"face_orientation",text="")
row.prop(game, "alpha_blend", text="")
row.prop(game, "face_orientation", text="")
class MATERIAL_PT_physics(MaterialButtonsPanel, bpy.types.Panel):
bl_label = "Physics"
COMPAT_ENGINES = {'BLENDER_GAME'}
def draw_header(self, context):
game = context.material.game_settings
self.layout.prop(game, "physics", text="")

@ -22,6 +22,7 @@ from bpy.types import Panel
from rna_prop_ui import PropertyPanel
from blf import gettext as _
class ObjectButtonsPanel():
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'

@ -21,6 +21,7 @@ import bpy
from bpy.types import Panel
from blf import gettext as _
class ConstraintButtonsPanel():
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
@ -754,7 +755,7 @@ class ConstraintButtonsPanel():
col.prop(con, "rotation_range", text=_("Pivot When"))
def SCRIPT(self, context, layout, con):
layout.label( _("Blender 2.5 has no py-constraints") )
layout.label(_("Blender 2.5 has no py-constraints"))
class OBJECT_PT_constraints(ConstraintButtonsPanel, Panel):

@ -22,6 +22,7 @@ import bpy
from bpy.types import Panel
from blf import gettext as _
class PhysicButtonsPanel():
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'

@ -21,6 +21,7 @@ import bpy
from bpy.types import Panel
from blf import gettext as _
class PhysicButtonsPanel():
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
@ -58,7 +59,7 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel, Panel):
layout.active = fluid.use
if fluid.type == 'DOMAIN':
layout.operator("fluid.bake", text=_("Bake (Req. Memory:")+" %s)" % fluid.memory_estimate, icon='MOD_FLUIDSIM')
layout.operator("fluid.bake", text=_("Bake (Req. Memory:") + " %s)" % fluid.memory_estimate, icon='MOD_FLUIDSIM')
split = layout.split()
col = split.column()

@ -22,6 +22,7 @@ from bpy.types import Operator, Panel
from rna_prop_ui import PropertyPanel
from blf import gettext as _
class SceneButtonsPanel():
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'

@ -372,13 +372,13 @@ class SEQUENCER_PT_edit(SequencerButtonsPanel, Panel):
col = layout.column(align=True)
row = col.row()
row.label(text=_("Final Length")+": %s" % bpy.utils.smpte_from_frame(strip.frame_final_duration))
row.label(text=_("Final Length") + ": %s" % bpy.utils.smpte_from_frame(strip.frame_final_duration))
row = col.row()
row.active = (frame_current >= strip.frame_start and frame_current <= strip.frame_start + strip.frame_duration)
row.label(text=_("Playhead")+": %d" % (frame_current - strip.frame_start))
row.label(text=_("Playhead") + ": %d" % (frame_current - strip.frame_start))
col.label(text=_("Frame Offset")+" %d:%d" % (strip.frame_offset_start, strip.frame_offset_end))
col.label(text=_("Frame Still")+" %d:%d" % (strip.frame_still_start, strip.frame_still_end))
col.label(text=_("Frame Offset") + " %d:%d" % (strip.frame_offset_start, strip.frame_offset_end))
col.label(text=_("Frame Still") + " %d:%d" % (strip.frame_still_start, strip.frame_still_end))
elem = False
@ -388,7 +388,7 @@ class SEQUENCER_PT_edit(SequencerButtonsPanel, Panel):
elem = strip.elements[0]
if elem and elem.orig_width > 0 and elem.orig_height > 0:
col.label(text=_("Orig Dim")+": %dx%d" % (elem.orig_width, elem.orig_height))
col.label(text=_("Orig Dim") + ": %dx%d" % (elem.orig_width, elem.orig_height))
else:
col.label(text=_("Orig Dim: None"))
@ -690,7 +690,7 @@ class SEQUENCER_PT_scene(SequencerButtonsPanel, Panel):
if scene:
sta = scene.frame_start
end = scene.frame_end
layout.label(text=_("Original frame range")+": %d-%d (%d)" % (sta, end, end - sta + 1))
layout.label(text=_("Original frame range") + ": %d-%d (%d)" % (sta, end, end - sta + 1))
class SEQUENCER_PT_filter(SequencerButtonsPanel, Panel):

@ -67,9 +67,9 @@ class TEXT_HT_header(Header):
row = layout.row()
if text.filepath:
if text.is_dirty:
row.label(text=_("File")+": *%r " % text.filepath+_("(unsaved)"))
row.label(text=_("File") + ": *%r " % text.filepath + _("(unsaved)"))
else:
row.label(text=_("File")+": %r" % text.filepath)
row.label(text=_("File") + ": %r" % text.filepath)
else:
row.label(text=_("Text: External")
if text.library

@ -650,7 +650,7 @@ class USERPREF_PT_theme(Panel):
col = split.column()
for i, ui in enumerate(theme.bone_color_sets):
col.label(text=_("Color Set")+" %d:" % (i + 1)) # i starts from 0
col.label(text=_("Color Set") + " %d:" % (i + 1)) # i starts from 0
row = col.row()

@ -202,7 +202,7 @@ class InputKeyMapPanel:
subcol = self.indented_layout(col, level + 1)
subrow = subcol.row()
subrow.prop(km, "show_expanded_items", text="", emboss=False)
subrow.label(text="%s " % _(km.name) + _("(Global)") )
subrow.label(text="%s " % _(km.name) + _("(Global)"))
else:
km.show_expanded_items = True

@ -21,11 +21,11 @@
set(INC
../include
../interface
../../blenfont
../../blenkernel
../../blenlib
../../blenloader
../../editors/interface
../../makesdna
../../makesrna
../../windowmanager

@ -25,7 +25,6 @@ import addon_utils
import sys
import os
import imp
def source_list(path, filename_check=None):