pep8 update & some minor cmake edits.
authorCampbell Barton <ideasman42@gmail.com>
Tue, 20 Sep 2011 18:29:19 +0000 (18:29 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 20 Sep 2011 18:29:19 +0000 (18:29 +0000)
29 files changed:
build_files/buildbot/master_unpack.py
build_files/cmake/cmake_static_check_cppcheck.py
build_files/cmake/cmake_static_check_splint.py
build_files/cmake/project_source_info.py
doc/python_api/sphinx_doc_gen.py
intern/audaspace/CMakeLists.txt
release/scripts/startup/bl_ui/properties_animviz.py
release/scripts/startup/bl_ui/properties_data_armature.py
release/scripts/startup/bl_ui/properties_data_bone.py
release/scripts/startup/bl_ui/properties_data_camera.py
release/scripts/startup/bl_ui/properties_data_curve.py
release/scripts/startup/bl_ui/properties_data_empty.py
release/scripts/startup/bl_ui/properties_data_lamp.py
release/scripts/startup/bl_ui/properties_data_mesh.py
release/scripts/startup/bl_ui/properties_data_metaball.py
release/scripts/startup/bl_ui/properties_data_modifier.py
release/scripts/startup/bl_ui/properties_game.py
release/scripts/startup/bl_ui/properties_material.py
release/scripts/startup/bl_ui/properties_object.py
release/scripts/startup/bl_ui/properties_object_constraint.py
release/scripts/startup/bl_ui/properties_physics_common.py
release/scripts/startup/bl_ui/properties_physics_fluid.py
release/scripts/startup/bl_ui/properties_scene.py
release/scripts/startup/bl_ui/space_sequencer.py
release/scripts/startup/bl_ui/space_text.py
release/scripts/startup/bl_ui/space_userpref.py
release/scripts/startup/bl_ui/space_userpref_keymap.py
source/blender/editors/space_logic/CMakeLists.txt
source/tests/bl_load_py_modules.py

index ad7c099..cb63c1d 100644 (file)
@@ -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():
index f6d4690..6eb9d4d 100644 (file)
@@ -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)
 
index 3614ab4..aa13ef8 100644 (file)
@@ -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",
     ]
 
index c4b83d2..670befb 100644 (file)
@@ -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"],
index 1792cb0..ca37030 100644 (file)
@@ -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)
index 25510eb..b7571ad 100644 (file)
@@ -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
index 499ea4c..d75541f 100644 (file)
@@ -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'
index e5729a2..97783c0 100644 (file)
@@ -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'
index 2c9b31f..54045cd 100644 (file)
@@ -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'
index 0d79ec9..6d6f4c2 100644 (file)
@@ -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'
index 861359f..4705119 100644 (file)
@@ -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'
index b6fa6d8..fac6d8f 100644 (file)
@@ -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'
index 93ed8ca..f488669 100644 (file)
@@ -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"
index 37c9137..82185b0 100644 (file)
@@ -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'}
index 693cb69..dbb947e 100644 (file)
@@ -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'
index 3232441..4719ae4 100644 (file)
@@ -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()
index 95ae54c..efe50b6 100644 (file)
@@ -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'
index 7b04c99..3a1a435 100644 (file)
@@ -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="")
index a099189..89ffd4d 100644 (file)
@@ -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'
index e7385d3..7b48834 100644 (file)
@@ -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):
index 20b76ec..7ca97c2 100644 (file)
@@ -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'
index c89d7ec..35c8466 100644 (file)
@@ -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()
index c82b4ac..7efb9cb 100644 (file)
@@ -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'
index a9a5eae..65aac4a 100644 (file)
@@ -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):
index cd72d42..23e6848 100644 (file)
@@ -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
index d0e7ae5..a31d479 100644 (file)
@@ -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()
 
index f8d77a1..a0a614e 100644 (file)
@@ -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
 
index f4bb255..c4f9f49 100644 (file)
 
 set(INC
        ../include
+       ../interface
        ../../blenfont
        ../../blenkernel
        ../../blenlib
        ../../blenloader
-       ../../editors/interface
        ../../makesdna
        ../../makesrna
        ../../windowmanager
index a88edd5..619cad6 100644 (file)
@@ -25,7 +25,6 @@ import addon_utils
 
 import sys
 import os
-import imp
 
 
 def source_list(path, filename_check=None):