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 ad7c09933c69ad2058d4b0dcc366733ba988c28b..cb63c1d3ffc3193fc5d76415bc530151afce0b22 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 f6d46904794059b94ddf9a5760043da10a816c14..6eb9d4da8b658bd551a6beb49c0d33a43c0a9925 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 3614ab48cf8ce1a97ebd4abee74f05327f547a2b..aa13ef82e3cb53b440be7e2b7a33a86fb55cfbeb 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 c4b83d20ea5bc6ead1b5af4e7173bf5a45489b7a..670befbf2aa184e3efa1a86df6e668e468047a52 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 1792cb002109f8f09fc73bf6bbe5407cdbd4dce7..ca37030074afa7e3622fd1c08cefa445337e5514 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 25510ebd2a5f99a10889c777eff555efd04b6551..b7571adf3d567fe6082a806f1fc221da7b3a0805 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 499ea4c95d41a46140d662e606c2ce15fcffb3bd..d75541feca0e8480382f20ddb8024f2663a5dba4 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 e5729a24b91600af29ee8be3d370968183ba782d..97783c09d4b4cc7ba5cefa0c6ef2098d89972374 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 2c9b31fd88d5630742a339a1edfc8339d43ac35c..54045cd7d6e3c01fe2f6f88768c9fbdb660a6fb6 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 0d79ec99789234a096611a064bf663e18684efc3..6d6f4c27ddff091a9b7d2d777484b6320d74ba6c 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 861359fbed4b7fb4895da363afacbda2f51652c1..47051194fc0e1bfdb878e9c943f89a93395f53da 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 b6fa6d8e8396ba1dff3a4504140f411cf742ecdf..fac6d8fcfb1967626303db2657732efed2fd0f0d 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 93ed8ca369bbbffe14afbaf93bf61d46d992ebf2..f488669b424d43a32b91cad6e3b4ea783fdf5aac 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 37c913709794617014414a5e85bad4a5996a7384..82185b0b1b059b42346d7ce6a45b06a4870059ef 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 693cb69754488f6d8593d01490f4727ac589bfca..dbb947e416c55585cda122bed4514dd03a21370f 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 3232441166984d2488ed50478e99a84fe7a362da..4719ae450f7a5ebb33882badce37d47b05dd7833 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 95ae54c4597c01e4408c28b31cf48bd618a8efc0..efe50b6fe2be3d2e71e3ae9867fbea8b1545da60 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 7b04c990c6a94d6324e3ecc2e08a39b0182b62cf..3a1a43589799a0c4ab92589dd04990929a1ef62f 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 a099189eed68f675132a6831a82a33929dde4ffb..89ffd4d3ed192ee9380bae6cc46980c284cbc9ac 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 e7385d3926b853aeabfa70cc82421090c5d06097..7b48834eb791edc5a67dca730f924a35320b30fc 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 20b76ec0a84fa616fff6e0062c6e50b587b1e15a..7ca97c204223d9e4ad4afce75f2a65f59521c64a 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 c89d7ec9755d616c236858993ad9189043c44f14..35c8466e685e1ee6eb47571ca25f3ec8359a695d 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 c82b4ac69dccd4f979c9ec902c501c70741ba020..7efb9cb6dc382adbc9e93fe83ad2b8a31c48718e 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 a9a5eae3179b2b767d2b2abe18d186e5e7aa2525..65aac4ae62f41cd549b7511b94759bf17cdcbf6f 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 cd72d42857b4b5c82337e01732eca1216d95c5ac..23e68487aaefe3e43f4208c2c5240538311d3d89 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 d0e7ae5e609605a0b39ceceae407c96804c4522c..a31d4791e72ab845aac242256e65dd51ec49b212 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 f8d77a1604b61f789f032289e7da0ac7b12564d9..a0a614e4fb4cb082df4438a35cc308ec9664a560 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 f4bb255e11ff9476b18d87636c78e8ba423fc1b7..c4f9f49c9a12d48bc16cf2303cfe0b27478de6bb 100644 (file)
 
 set(INC
        ../include
+       ../interface
        ../../blenfont
        ../../blenkernel
        ../../blenlib
        ../../blenloader
-       ../../editors/interface
        ../../makesdna
        ../../makesrna
        ../../windowmanager
index a88edd5f1fea3489b7cbb2f569f914d567989ca2..619cad67cb8e801b15e412a1b67e464cff3514ec 100644 (file)
@@ -25,7 +25,6 @@ import addon_utils
 
 import sys
 import os
-import imp
 
 
 def source_list(path, filename_check=None):