[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [31815] trunk/blender: ran through pep8 checker

Campbell Barton ideasman42 at gmail.com
Tue Sep 7 17:17:42 CEST 2010


Revision: 31815
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=31815
Author:   campbellbarton
Date:     2010-09-07 17:17:42 +0200 (Tue, 07 Sep 2010)

Log Message:
-----------
ran through pep8 checker

Modified Paths:
--------------
    trunk/blender/build_files/cmake/example_scripts/make_quicky.py
    trunk/blender/doc/blender.1.py
    trunk/blender/intern/tools/pydna.py
    trunk/blender/release/scripts/modules/add_object_utils.py
    trunk/blender/release/scripts/modules/blend_render_info.py
    trunk/blender/release/scripts/modules/bpy/__init__.py
    trunk/blender/release/scripts/modules/bpy/ops.py
    trunk/blender/release/scripts/modules/bpy/path.py
    trunk/blender/release/scripts/modules/bpy/utils.py
    trunk/blender/release/scripts/modules/bpy_types.py
    trunk/blender/release/scripts/modules/bpyml.py
    trunk/blender/release/scripts/modules/bpyml_ui.py
    trunk/blender/release/scripts/modules/graphviz_export.py
    trunk/blender/release/scripts/modules/io_utils.py
    trunk/blender/release/scripts/modules/rna_info.py
    trunk/blender/release/scripts/modules/rna_prop_ui.py
    trunk/blender/release/scripts/op/add_armature_human.py
    trunk/blender/release/scripts/op/console_python.py
    trunk/blender/release/scripts/op/image.py
    trunk/blender/release/scripts/op/io_scene_fbx/__init__.py
    trunk/blender/release/scripts/op/mesh.py
    trunk/blender/release/scripts/op/nla.py
    trunk/blender/release/scripts/op/object.py
    trunk/blender/release/scripts/op/object_randomize_transform.py
    trunk/blender/release/scripts/op/presets.py
    trunk/blender/release/scripts/op/screen_play_rendered_anim.py
    trunk/blender/release/scripts/op/uv.py
    trunk/blender/release/scripts/op/wm.py
    trunk/blender/release/scripts/ui/properties_animviz.py
    trunk/blender/release/scripts/ui/properties_data_armature.py
    trunk/blender/release/scripts/ui/properties_data_armature_rigify.py
    trunk/blender/release/scripts/ui/properties_data_bone.py
    trunk/blender/release/scripts/ui/properties_data_curve.py
    trunk/blender/release/scripts/ui/properties_data_empty.py
    trunk/blender/release/scripts/ui/properties_data_lamp.py
    trunk/blender/release/scripts/ui/properties_data_lattice.py
    trunk/blender/release/scripts/ui/properties_data_mesh.py
    trunk/blender/release/scripts/ui/properties_game.py
    trunk/blender/release/scripts/ui/properties_material.py
    trunk/blender/release/scripts/ui/properties_object.py
    trunk/blender/release/scripts/ui/properties_object_constraint.py
    trunk/blender/release/scripts/ui/properties_particle.py
    trunk/blender/release/scripts/ui/properties_physics_common.py
    trunk/blender/release/scripts/ui/properties_physics_field.py
    trunk/blender/release/scripts/ui/properties_physics_fluid.py
    trunk/blender/release/scripts/ui/properties_physics_smoke.py
    trunk/blender/release/scripts/ui/properties_physics_softbody.py
    trunk/blender/release/scripts/ui/properties_render.py
    trunk/blender/release/scripts/ui/properties_scene.py
    trunk/blender/release/scripts/ui/properties_texture.py
    trunk/blender/release/scripts/ui/properties_world.py
    trunk/blender/release/scripts/ui/space_dopesheet.py
    trunk/blender/release/scripts/ui/space_filebrowser.py
    trunk/blender/release/scripts/ui/space_image.py
    trunk/blender/release/scripts/ui/space_info.py
    trunk/blender/release/scripts/ui/space_logic.py
    trunk/blender/release/scripts/ui/space_node.py
    trunk/blender/release/scripts/ui/space_sequencer.py
    trunk/blender/release/scripts/ui/space_text.py
    trunk/blender/release/scripts/ui/space_time.py
    trunk/blender/release/scripts/ui/space_userpref.py
    trunk/blender/release/scripts/ui/space_userpref_keymap.py
    trunk/blender/release/scripts/ui/space_view3d.py
    trunk/blender/release/scripts/ui/space_view3d_toolbar.py
    trunk/blender/release/test/rna_info_dump.py

Modified: trunk/blender/build_files/cmake/example_scripts/make_quicky.py
===================================================================
--- trunk/blender/build_files/cmake/example_scripts/make_quicky.py	2010-09-07 12:28:16 UTC (rev 31814)
+++ trunk/blender/build_files/cmake/example_scripts/make_quicky.py	2010-09-07 15:17:42 UTC (rev 31815)
@@ -20,6 +20,7 @@
 
 # <pep8 compliant>
 
+
 def print_help(targets):
     print("CMake quicky wrapper, no valid targets given.")
     print(" * targets can contain a subset of the full target name.")
@@ -36,11 +37,11 @@
     for t in targets:
         print("    %s" % t)
     print("...exiting")
-    
 
+
 def main():
     targets = set()
-    
+
     # collect targets
     file = open("Makefile", "r")
     for line in file:
@@ -54,13 +55,12 @@
 
         line = line.split(":", 1)[0]
 
-        if "/" in line: # cmake terget options, dont need these
+        if "/" in line:  # cmake terget options, dont need these
             continue
 
         targets.add(line)
     file.close()
 
-
     # remove cmake targets
     bad = set([
         "help",
@@ -75,10 +75,9 @@
         "depend",
         "cmake_check_build_system",
         ])
-        
+
     targets -= set(bad)
 
-
     # parse args
     targets = list(targets)
     targets.sort()
@@ -106,7 +105,7 @@
                     print("    %s" % t)
                 print("...aborting.")
                 return
-    
+
     # execute
     cmd = "make %s %s blender/fast" % (" ".join(args), " ".join(targets_new))
     print("cmake building with targets: %s" % " ".join(targets_new))

Modified: trunk/blender/doc/blender.1.py
===================================================================
--- trunk/blender/doc/blender.1.py	2010-09-07 12:28:16 UTC (rev 31814)
+++ trunk/blender/doc/blender.1.py	2010-09-07 15:17:42 UTC (rev 31815)
@@ -91,25 +91,25 @@
     l = lines.pop(0)
     if l.startswith("Environment Variables:"):
         fw('.SH "ENVIRONMENT VARIABLES"\n')
-    elif l.endswith(":"): # one line
+    elif l.endswith(":"):  # one line
         fw('.SS "%s"\n\n' % l)
-    elif l.startswith("-") or l.startswith("/"): # can be multi line
+    elif l.startswith("-") or l.startswith("/"):  # can be multi line
 
         fw('.TP\n')
         fw('.B %s\n' % man_format(l))
 
         while lines:
             # line with no
-            if lines[0].strip() and len(lines[0].lstrip()) == len(lines[0]): # no white space
+            if lines[0].strip() and len(lines[0].lstrip()) == len(lines[0]):  # no white space
                 break
 
-            if not l: # second blank line
+            if not l:  # second blank line
                 fw('.IP\n')
             else:
                 fw('.br\n')
 
             l = lines.pop(0)
-            l = l[1:] # remove first whitespace (tab)
+            l = l[1:]  # remove first whitespace (tab)
 
             fw('%s\n' % man_format(l))
 

Modified: trunk/blender/intern/tools/pydna.py
===================================================================
--- trunk/blender/intern/tools/pydna.py	2010-09-07 12:28:16 UTC (rev 31814)
+++ trunk/blender/intern/tools/pydna.py	2010-09-07 15:17:42 UTC (rev 31815)
@@ -45,6 +45,7 @@
 import ctypes
 import struct
 
+
 def _api():
 
     def is_ctypes_subclass(other, main_class):
@@ -54,7 +55,6 @@
             other = getattr(other, "_type_", None)
         return False
 
-
     def is_ctypes_initialized(other):
         _other = other
         while other:
@@ -64,7 +64,6 @@
         print(_other, "NOT INIT")
         return False
 
-
     def is_ctypes_base(other):
         while type(getattr(other, "_type_", "")) != str:
             other = other._type_
@@ -85,7 +84,7 @@
         sdna_len_pt = ctypes.c_void_p.from_address(ctypes.addressof(sdna_len_pt))
         sdna_len = ctypes.c_int.from_address(sdna_len_pt.value)
 
-        blend_sdna = ctypes.string_at(sdna_str_pt, sdna_len) # 58064
+        blend_sdna = ctypes.string_at(sdna_str_pt, sdna_len)
         
         ofs = 0
         assert(blend_sdna[ofs:ofs + 8] == b'SDNANAME')
@@ -95,7 +94,7 @@
         ofs += 4
         
         blend_sdna_names = blend_sdna[ofs:].split(b'\0', sdna_names_len)
-        blend_sdna_remainder = blend_sdna_names.pop(-1) # last item is not a name.
+        blend_sdna_remainder = blend_sdna_names.pop(-1)  # last item is not a name.
         ofs = len(blend_sdna) - len(blend_sdna_remainder)
         ofs = (ofs + 3) & ~3
 
@@ -123,10 +122,9 @@
         
         sdna_structs_len = struct.unpack("i", blend_sdna[ofs:ofs + 4])[0]
         ofs += 4
-        
-        
+
         blend_sdna_structs = []
-        
+
         for i in range(sdna_structs_len):
             struct_type, struct_tot = struct.unpack("hh", blend_sdna[ofs:ofs + 4])
             ofs += 4
@@ -167,7 +165,7 @@
 
                 # * First parse the pointer *
                 pointer_count = 0
-                while name_string[0] == 42: # '*'
+                while name_string[0] == 42:  # '*'
                     pointer_count += 1
                     name_string = name_string[1:]
                 
@@ -232,8 +230,6 @@
                 ret = type_cast_link.from_address(ctypes.addressof(self.first))
             except:
                 ret = type_cast_link.from_address(self.first)
-                
-                
 
             while ret is not None:
                 return_value = type_cast.from_address(ctypes.addressof(ret))
@@ -257,7 +253,6 @@
         
         MixIn.CAST = CAST
 
-
     blend_sdna_names, blend_sdna_types, blend_sdna_typelens, blend_sdna_structs = blend_parse_dna()
     struct_dict = create_dna_structs(blend_sdna_names, blend_sdna_types, blend_sdna_typelens, blend_sdna_structs)
 
@@ -272,8 +267,7 @@
         print("} %s;" % sruct_name)
     '''
     
-    decorate_api(struct_dict) # not essential but useful
-        
+    decorate_api(struct_dict)  # not essential but useful
     
     # manually wrap Main
     Main = type("Main", (ctypes.Structure, ), {})

Modified: trunk/blender/release/scripts/modules/add_object_utils.py
===================================================================
--- trunk/blender/release/scripts/modules/add_object_utils.py	2010-09-07 12:28:16 UTC (rev 31814)
+++ trunk/blender/release/scripts/modules/add_object_utils.py	2010-09-07 15:17:42 UTC (rev 31815)
@@ -60,7 +60,6 @@
     if context.space_data and context.space_data.type == 'VIEW_3D':
         base.layers_from_view(context.space_data)
 
-
     obj_new.matrix_world = add_object_align_init(context, operator)
 
     obj_act = scene.objects.active
@@ -69,10 +68,10 @@
         bpy.ops.object.mode_set(mode='OBJECT')
 
         obj_act.select = True
-        scene.update() # apply location
+        scene.update()  # apply location
         #scene.objects.active = obj_new
 
-        bpy.ops.object.join() # join into the active.
+        bpy.ops.object.join()  # join into the active.
 
         bpy.ops.object.mode_set(mode='EDIT')
     else:

Modified: trunk/blender/release/scripts/modules/blend_render_info.py
===================================================================
--- trunk/blender/release/scripts/modules/blend_render_info.py	2010-09-07 12:28:16 UTC (rev 31814)
+++ trunk/blender/release/scripts/modules/blend_render_info.py	2010-09-07 15:17:42 UTC (rev 31815)
@@ -40,7 +40,7 @@
 
     head = blendfile.read(7)
 
-    if head[0:2] == b'\x1f\x8b': # gzip magic
+    if head[0:2] == b'\x1f\x8b':  # gzip magic
         import gzip
         blendfile.close()
         blendfile = gzip.open(path, 'rb')
@@ -57,7 +57,7 @@
     is_big_endian = (blendfile.read(1) == b'V')
 
     # Now read the bhead chunk!!!
-    blendfile.read(3) # skip the version
+    blendfile.read(3)  # skip the version
 
     scenes = []
 

Modified: trunk/blender/release/scripts/modules/bpy/__init__.py
===================================================================
--- trunk/blender/release/scripts/modules/bpy/__init__.py	2010-09-07 12:28:16 UTC (rev 31814)
+++ trunk/blender/release/scripts/modules/bpy/__init__.py	2010-09-07 15:17:42 UTC (rev 31815)
@@ -50,7 +50,6 @@
     pydoc.Helper.getline = lambda self, prompt: None
     pydoc.TextDoc.use_bold = lambda self, text: text
 
-
     # if "-d" in sys.argv: # Enable this to measure startup speed
     if 0:
         import cProfile

Modified: trunk/blender/release/scripts/modules/bpy/ops.py
===================================================================
--- trunk/blender/release/scripts/modules/bpy/ops.py	2010-09-07 12:28:16 UTC (rev 31814)
+++ trunk/blender/release/scripts/modules/bpy/ops.py	2010-09-07 15:17:42 UTC (rev 31815)
@@ -164,7 +164,7 @@
         if 'FINISHED' in ret:
             import bpy
             scene = bpy.context.scene
-            if scene: # None in backgroud mode
+            if scene:  # None in backgroud mode
                 scene.update()
             else:
                 for scene in bpy.data.scenes:
@@ -178,14 +178,14 @@
         '''
         return op_get_rna(self.idname())
 
-    def __repr__(self): # useful display, repr(op)
+    def __repr__(self):  # useful display, repr(op)
         import bpy
         idname = self.idname()
         as_string = op_as_string(idname)
         descr = getattr(bpy.types, idname).bl_rna.description
         return as_string + "\n" + descr
 
-    def __str__(self): # used for print(...)
+    def __str__(self):  # used for print(...)
         return "<function bpy.ops.%s.%s at 0x%x'>" % \
                 (self.module, self.func, id(self))
 

Modified: trunk/blender/release/scripts/modules/bpy/path.py
===================================================================
--- trunk/blender/release/scripts/modules/bpy/path.py	2010-09-07 12:28:16 UTC (rev 31814)
+++ trunk/blender/release/scripts/modules/bpy/path.py	2010-09-07 15:17:42 UTC (rev 31815)
@@ -26,6 +26,7 @@
 import bpy as _bpy
 import os as _os
 
+
 def abspath(path):
     """
     Returns the absolute path relative to the current blend file using the "//" prefix.
@@ -99,58 +100,58 @@
 
 
 def resolve_ncase(path):
-	"""
-	Resolve a case insensitive path on a case sensitive system,
-	returning a string with the path if found else return the original path.
-	"""
+    """
+    Resolve a case insensitive path on a case sensitive system,
+    returning a string with the path if found else return the original path.
+    """
 
-	import os
+    import os
 
-	def _ncase_path_found(path):
-		if path=='' or os.path.exists(path):
-			return path, True
+    def _ncase_path_found(path):

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list