[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [44730] trunk/blender: style cleanup: pep8 + picky edits

Campbell Barton ideasman42 at gmail.com
Thu Mar 8 06:36:21 CET 2012


Revision: 44730
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=44730
Author:   campbellbarton
Date:     2012-03-08 05:36:05 +0000 (Thu, 08 Mar 2012)
Log Message:
-----------
style cleanup: pep8 + picky edits

Modified Paths:
--------------
    trunk/blender/doc/python_api/sphinx_doc_gen.py
    trunk/blender/intern/cycles/blender/addon/enums.py
    trunk/blender/intern/cycles/blender/addon/ui.py
    trunk/blender/release/scripts/modules/bpy_types.py
    trunk/blender/release/scripts/startup/bl_operators/uvcalc_follow_active.py
    trunk/blender/release/scripts/startup/bl_ui/properties_data_curve.py
    trunk/blender/release/scripts/startup/bl_ui/properties_data_modifier.py
    trunk/blender/release/scripts/startup/bl_ui/space_view3d.py
    trunk/blender/source/blender/blenkernel/intern/subsurf_ccg.c
    trunk/blender/source/blender/blenlib/CMakeLists.txt
    trunk/blender/source/blender/editors/space_view3d/drawobject.c
    trunk/blender/source/blender/makesrna/intern/CMakeLists.txt
    trunk/blender/source/tools/spell_check_source.py

Modified: trunk/blender/doc/python_api/sphinx_doc_gen.py
===================================================================
--- trunk/blender/doc/python_api/sphinx_doc_gen.py	2012-03-08 04:38:35 UTC (rev 44729)
+++ trunk/blender/doc/python_api/sphinx_doc_gen.py	2012-03-08 05:36:05 UTC (rev 44730)
@@ -79,6 +79,7 @@
 
 SCRIPT_DIR = os.path.dirname(__file__)
 
+
 def handle_args():
     '''
     Parse the args passed to Blender after "--", ignored by Blender
@@ -127,7 +128,6 @@
                         help="Write the rst file of the bpy module (default=False)",
                         required=False)
 
-    
     # parse only the args passed after '--'
     argv = []
     if "--" in sys.argv:
@@ -227,7 +227,7 @@
 
 def sphinx_dirs():
     '''
-    Directories where we write rst files for Sphinx 
+    Directories where we write rst files for Sphinx
     '''
     if not os.path.exists(ARGS.output_dir):
         os.mkdir(ARGS.output_dir)
@@ -237,7 +237,7 @@
     sphinx_in_tmp = sphinx_in + "-tmp"
     if not os.path.exists(sphinx_in):
         os.mkdir(sphinx_in)
-    
+
     return sphinx_in, sphinx_in_tmp, sphinx_out
 
 SPHINX_THEME = ARGS.sphinx_theme
@@ -258,7 +258,7 @@
 BLENDER_VERSION_DOTS = ".".join(version_strings)    # '2.62.1'
 if bpy.app.build_revision != b"Unknown":
     # converting bytes to strings, due to #30154
-    BLENDER_VERSION_DOTS += " r" + str(bpy.app.build_revision, 'utf_8') # '2.62.1 r44584'
+    BLENDER_VERSION_DOTS += " r" + str(bpy.app.build_revision, 'utf_8')  # '2.62.1 r44584'
 
 BLENDER_VERSION_PDF = "_".join(version_strings)    # '2_62_1'
 if bpy.app.version_cycle == "release":
@@ -1203,9 +1203,9 @@
                     else:
                         url_base = API_BASEURL
 
-                    fw("   :file: `%s <%s/%s>`_:%d\n\n" % (location[0], 
-                                                           url_base, 
-                                                           location[0], 
+                    fw("   :file: `%s <%s/%s>`_:%d\n\n" % (location[0],
+                                                           url_base,
+                                                           location[0],
                                                            location[1]))
 
             file.close()
@@ -1221,7 +1221,7 @@
     filepath = os.path.join(basepath, "conf.py")
     file = open(filepath, "w", encoding="utf-8")
     fw = file.write
-    
+
     fw("project = 'Blender'\n")
     # fw("master_doc = 'index'\n")
     fw("copyright = u'Blender Foundation'\n")
@@ -1238,7 +1238,7 @@
     # not helpful since the source is generated, adds to upload size.
     fw("html_copy_source = False\n")
     fw("\n")
-    
+
     # needed for latex, pdf gen
     fw("latex_documents = [ ('contents', 'contents.tex', 'Blender Index', 'Blender Foundation', 'manual'), ]\n")
     fw("latex_paper_size = 'a4paper'\n")
@@ -1283,26 +1283,26 @@
     fw("\n")
     fw(".. toctree::\n")
     fw("   :maxdepth: 1\n\n")
-    
+
     app_modules = [
         "bpy.context",  # note: not actually a module
         "bpy.data",     # note: not actually a module
         "bpy.ops",
         "bpy.types",
-        
+
         # py modules
         "bpy.utils",
         "bpy.path",
         "bpy.app",
         "bpy.app.handlers",
-        
+
         # C modules
         "bpy.props"
     ]
     for mod in app_modules:
         if mod not in EXCLUDE_MODULES:
             fw("   %s\n\n" % mod)
- 
+
     fw("==================\n")
     fw("Standalone Modules\n")
     fw("==================\n")
@@ -1475,12 +1475,12 @@
 
 
 def copy_handwritten_rsts(basepath):
-    
+
     # info docs
     if not EXCLUDE_INFO_DOCS:
         for info, info_desc in INFO_DOCS:
             shutil.copy2(os.path.join(RST_DIR, info), basepath)
-    
+
     # TODO put this docs in blender's code and use import as per modules above
     handwritten_modules = [
         "bge.types",
@@ -1522,13 +1522,13 @@
             pycontext2sphinx(basepath)
 
     # internal modules
-    write_rst_bpy(basepath)                 # bpy, disabled by default    
+    write_rst_bpy(basepath)                 # bpy, disabled by default
     write_rst_types_index(basepath)         # bpy.types
     write_rst_ops_index(basepath)           # bpy.ops
     pyrna2sphinx(basepath)                  # bpy.types.* and bpy.ops.*
     write_rst_data(basepath)                # bpy.data
     write_rst_importable_modules(basepath)
-    
+
     # copy the other rsts
     copy_handwritten_rsts(basepath)
 

Modified: trunk/blender/intern/cycles/blender/addon/enums.py
===================================================================
--- trunk/blender/intern/cycles/blender/addon/enums.py	2012-03-08 04:38:35 UTC (rev 44729)
+++ trunk/blender/intern/cycles/blender/addon/enums.py	2012-03-08 05:36:05 UTC (rev 44730)
@@ -21,37 +21,36 @@
 from . import engine
 
 devices = (
-    ("CPU", "CPU", "Use CPU for rendering"),
-    ("GPU", "GPU Compute", "Use GPU compute device for rendering, configured in user preferences"))
+    ('CPU', "CPU", "Use CPU for rendering"),
+    ('GPU', "GPU Compute", "Use GPU compute device for rendering, configured in user preferences"))
 
 feature_set = (
-    ("SUPPORTED", "Supported", "Only use finished and supported features"),
-    ("EXPERIMENTAL", "Experimental", "Use experimental and incomplete features that might be broken or change in the future"),
+    ('SUPPORTED', "Supported", "Only use finished and supported features"),
+    ('EXPERIMENTAL', "Experimental", "Use experimental and incomplete features that might be broken or change in the future"),
     )
 
 shading_systems = (
-    ("GPU_COMPATIBLE", "GPU Compatible", "Restricted shading system compatible with GPU rendering"),
-    ("OSL", "Open Shading Language", "Open Shading Language shading system that only runs on the CPU"),
+    ('GPU_COMPATIBLE', "GPU Compatible", "Restricted shading system compatible with GPU rendering"),
+    ('OSL', "Open Shading Language", "Open Shading Language shading system that only runs on the CPU"),
     )
 
 displacement_methods = (
-    ("BUMP", "Bump", "Bump mapping to simulate the appearance of displacement"),
-    ("TRUE", "True", "Use true displacement only, requires fine subdivision"),
-    ("BOTH", "Both", "Combination of displacement and bump mapping"),
+    ('BUMP', "Bump", "Bump mapping to simulate the appearance of displacement"),
+    ('TRUE', "True", "Use true displacement only, requires fine subdivision"),
+    ('BOTH', "Both", "Combination of displacement and bump mapping"),
     )
 
 bvh_types = (
-    ("DYNAMIC_BVH", "Dynamic BVH", "Objects can be individually updated, at the cost of slower render time"),
-    ("STATIC_BVH", "Static BVH", "Any object modification requires a complete BVH rebuild, but renders faster"),
+    ('DYNAMIC_BVH', "Dynamic BVH", "Objects can be individually updated, at the cost of slower render time"),
+    ('STATIC_BVH', "Static BVH", "Any object modification requires a complete BVH rebuild, but renders faster"),
     )
 
 filter_types = (
-    ("BOX", "Box", "Box filter"),
-    ("GAUSSIAN", "Gaussian", "Gaussian filter"),
+    ('BOX', "Box", "Box filter"),
+    ('GAUSSIAN', "Gaussian", "Gaussian filter"),
     )
 
 aperture_types = (
-    ("RADIUS", "Radius", "Directly change the size of the aperture"),
-    ("FSTOP", "F/stop", "Change the size of the aperture by f/stops"),
+    ('RADIUS', "Radius", "Directly change the size of the aperture"),
+    ('FSTOP', "F/stop", "Change the size of the aperture by f/stops"),
     )
-

Modified: trunk/blender/intern/cycles/blender/addon/ui.py
===================================================================
--- trunk/blender/intern/cycles/blender/addon/ui.py	2012-03-08 04:38:35 UTC (rev 44729)
+++ trunk/blender/intern/cycles/blender/addon/ui.py	2012-03-08 05:36:05 UTC (rev 44730)
@@ -489,6 +489,7 @@
         if not panel_node_draw(layout, world, 'OUTPUT_WORLD', 'Surface'):
             layout.prop(world, "horizon_color", text="Color")
 
+
 class CyclesWorld_PT_volume(CyclesButtonsPanel, Panel):
     bl_label = "Volume"
     bl_context = "world"
@@ -507,6 +508,7 @@
         world = context.world
         panel_node_draw(layout, world, 'OUTPUT_WORLD', 'Volume')
 
+
 class CyclesWorld_PT_ambient_occlusion(CyclesButtonsPanel, Panel):
     bl_label = "Ambient Occlusion"
     bl_context = "world"
@@ -529,6 +531,7 @@
         split.prop(light, "ao_factor", text="Factor")
         split.prop(light, "distance", text="Distance")
 
+
 class CyclesWorld_PT_settings(CyclesButtonsPanel, Panel):
     bl_label = "Settings"
     bl_context = "world"
@@ -551,6 +554,7 @@
         row.active = cworld.sample_as_light
         row.prop(cworld, "sample_map_resolution")
 
+
 class CyclesMaterial_PT_surface(CyclesButtonsPanel, Panel):
     bl_label = "Surface"
     bl_context = "material"

Modified: trunk/blender/release/scripts/modules/bpy_types.py
===================================================================
--- trunk/blender/release/scripts/modules/bpy_types.py	2012-03-08 04:38:35 UTC (rev 44729)
+++ trunk/blender/release/scripts/modules/bpy_types.py	2012-03-08 05:36:05 UTC (rev 44730)
@@ -446,6 +446,7 @@
                     ord_ind(verts[3], verts[0]),
                     )
 
+
 class MeshPolygon(StructRNA):
     __slots__ = ()
 
@@ -453,7 +454,7 @@
     def edge_keys(self):
         verts = self.vertices[:]
         vlen = len(self.vertices)
-        return [ord_ind(verts[i], verts[(i+1) % vlen]) for i in range(vlen)]
+        return [ord_ind(verts[i], verts[(i + 1) % vlen]) for i in range(vlen)]
 
     @property
     def loops(self):
@@ -461,6 +462,7 @@
         end = start + self.loop_total
         return range(start, end)
 
+
 class Text(bpy_types.ID):
     __slots__ = ()
 

Modified: trunk/blender/release/scripts/startup/bl_operators/uvcalc_follow_active.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_operators/uvcalc_follow_active.py	2012-03-08 04:38:35 UTC (rev 44729)
+++ trunk/blender/release/scripts/startup/bl_operators/uvcalc_follow_active.py	2012-03-08 05:36:05 UTC (rev 44730)
@@ -54,7 +54,7 @@
 
         def face_edge_vs(vi):
             vlen = len(vi)
-            return [(vi[i], vi[(i+1) % vlen]) for i in range(vlen)]
+            return [(vi[i], vi[(i + 1) % vlen]) for i in range(vlen)]
 
         vidx_source = face_source.vertices
         vidx_target = face_target.vertices


@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list