correct spelling error and some pep8 changes.
authorCampbell Barton <ideasman42@gmail.com>
Thu, 26 May 2011 09:33:51 +0000 (09:33 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 26 May 2011 09:33:51 +0000 (09:33 +0000)
build_files/cmake/cmake_netbeans_project.py
build_files/cmake/cmake_qtcreator_project.py
build_files/cmake/project_info.py
doc/python_api/examples/bpy.types.BlendDataLibraries.load.py
release/scripts/modules/bpy_extras/mesh_utils.py
release/scripts/modules/bpy_extras/view3d_utils.py
release/scripts/startup/bl_operators/uvcalc_follow_active.py
release/scripts/startup/bl_ui/properties_data_empty.py
release/scripts/startup/bl_ui/properties_object_constraint.py
release/scripts/startup/bl_ui/space_image.py

index c8bedb551481b0fce9cd8ec572dce2e5297fea85..6afca8f3b6a1712daf0cfc2146198f9a8c0b78f4 100755 (executable)
@@ -33,7 +33,7 @@ Windows not supported so far
 from project_info import *
 
 import os
-from os.path import join, dirname, normpath, abspath, splitext, relpath, exists
+from os.path import join, dirname, normpath, relpath, exists
 
 
 def create_nb_project_main():
@@ -50,7 +50,6 @@ def create_nb_project_main():
         includes.sort()
 
         PROJECT_NAME = "Blender"
-        FILE_NAME = PROJECT_NAME.lower()
 
         # --------------- NB spesific
         defines = [("%s=%s" % cdef) if cdef[1] else cdef[0] for cdef in defines]
@@ -76,7 +75,7 @@ def create_nb_project_main():
         if not exists(PROJECT_DIR_NB):
             os.mkdir(PROJECT_DIR_NB)
 
-        SOURCE_DIR_REL = relpath(SOURCE_DIR, PROJECT_DIR)
+        SOURCE_DIR_REL = relpath(SOURCE_DIR, PROJECT_DIR)
 
         f = open(join(PROJECT_DIR_NB, "project.xml"), 'w')
 
index e38b2228ccac615f8234e25f68c7d3eb62490f18..3de15567727433787e5e997adecfee76690db74d 100755 (executable)
@@ -34,54 +34,52 @@ example linux usage
 from project_info import *
 
 import os
-from os.path import join, dirname, normpath, abspath, splitext, relpath, exists
-
 import sys
 
 
 def create_qtc_project_main():
     files = list(source_list(SOURCE_DIR, filename_check=is_project_file))
-    files_rel = [relpath(f, start=PROJECT_DIR) for f in files]
+    files_rel = [os.path.relpath(f, start=PROJECT_DIR) for f in files]
     files_rel.sort()
 
     # --- qtcreator specific, simple format
     if SIMPLE_PROJECTFILE:
         # --- qtcreator specific, simple format
         PROJECT_NAME = "Blender"
-        f = open(join(PROJECT_DIR, "%s.files" % PROJECT_NAME), 'w')
+        f = open(os.path.join(PROJECT_DIR, "%s.files" % PROJECT_NAME), 'w')
         f.write("\n".join(files_rel))
 
-        f = open(join(PROJECT_DIR, "%s.includes" % PROJECT_NAME), 'w')
-        f.write("\n".join(sorted(list(set(dirname(f) for f in files_rel if is_c_header(f))))))
+        f = open(os.path.join(PROJECT_DIR, "%s.includes" % PROJECT_NAME), 'w')
+        f.write("\n".join(sorted(list(set(os.path.dirname(f) for f in files_rel if is_c_header(f))))))
 
-        qtc_prj = join(PROJECT_DIR, "%s.creator" % PROJECT_NAME)
+        qtc_prj = os.path.join(PROJECT_DIR, "%s.creator" % PROJECT_NAME)
         f = open(qtc_prj, 'w')
         f.write("[General]\n")
 
-        qtc_cfg = join(PROJECT_DIR, "%s.config" % PROJECT_NAME)
-        if not exists(qtc_cfg):
+        qtc_cfg = os.path.join(PROJECT_DIR, "%s.config" % PROJECT_NAME)
+        if not os.path.exists(qtc_cfg):
             f = open(qtc_cfg, 'w')
             f.write("// ADD PREDEFINED MACROS HERE!\n")
     else:
         includes, defines = cmake_advanced_info()
 
         # for some reason it doesnt give all internal includes
-        includes = list(set(includes) | set(dirname(f) for f in files_rel if is_c_header(f)))
+        includes = list(set(includes) | set(os.path.dirname(f) for f in files_rel if is_c_header(f)))
         includes.sort()
 
         PROJECT_NAME = "Blender"
         FILE_NAME = PROJECT_NAME.lower()
-        f = open(join(PROJECT_DIR, "%s.files" % FILE_NAME), 'w')
+        f = open(os.path.join(PROJECT_DIR, "%s.files" % FILE_NAME), 'w')
         f.write("\n".join(files_rel))
 
-        f = open(join(PROJECT_DIR, "%s.includes" % FILE_NAME), 'w')
+        f = open(os.path.join(PROJECT_DIR, "%s.includes" % FILE_NAME), 'w')
         f.write("\n".join(sorted(includes)))
 
-        qtc_prj = join(PROJECT_DIR, "%s.creator" % FILE_NAME)
+        qtc_prj = os.path.join(PROJECT_DIR, "%s.creator" % FILE_NAME)
         f = open(qtc_prj, 'w')
         f.write("[General]\n")
 
-        qtc_cfg = join(PROJECT_DIR, "%s.config" % FILE_NAME)
+        qtc_cfg = os.path.join(PROJECT_DIR, "%s.config" % FILE_NAME)
         f = open(qtc_cfg, 'w')
         f.write("// ADD PREDEFINED MACROS HERE!\n")
         defines_final = [("#define %s %s" % item) for item in defines]
@@ -95,21 +93,21 @@ def create_qtc_project_main():
 
 def create_qtc_project_python():
     files = list(source_list(SOURCE_DIR, filename_check=is_py))
-    files_rel = [relpath(f, start=PROJECT_DIR) for f in files]
+    files_rel = [os.path.relpath(f, start=PROJECT_DIR) for f in files]
     files_rel.sort()
 
     # --- qtcreator specific, simple format
     PROJECT_NAME = "Blender_Python"
     FILE_NAME = PROJECT_NAME.lower()
-    f = open(join(PROJECT_DIR, "%s.files" % FILE_NAME), 'w')
+    f = open(os.path.join(PROJECT_DIR, "%s.files" % FILE_NAME), 'w')
     f.write("\n".join(files_rel))
 
-    qtc_prj = join(PROJECT_DIR, "%s.creator" % FILE_NAME)
+    qtc_prj = os.path.join(PROJECT_DIR, "%s.creator" % FILE_NAME)
     f = open(qtc_prj, 'w')
     f.write("[General]\n")
 
-    qtc_cfg = join(PROJECT_DIR, "%s.config" % FILE_NAME)
-    if not exists(qtc_cfg):
+    qtc_cfg = os.path.join(PROJECT_DIR, "%s.config" % FILE_NAME)
+    if not os.path.exists(qtc_cfg):
         f = open(qtc_cfg, 'w')
         f.write("// ADD PREDEFINED MACROS HERE!\n")
 
index c25fbf4128d7e9be00a53ae4df13687c651d5aee..db12884469b0de0eeff32f5957b1890b5dfacf57 100755 (executable)
@@ -46,7 +46,7 @@ __all__ = (
 
 import sys
 import os
-from os.path import join, dirname, normpath, abspath, splitext, relpath, exists
+from os.path import join, dirname, normpath, abspath, splitext, exists
 
 SOURCE_DIR = join(dirname(__file__), "..", "..")
 SOURCE_DIR = normpath(SOURCE_DIR)
index 594f36e4340f1d1a69ffdb44b4392eee05eb5360..42e2a71cc70893af22deb0b5d232fbbe8a6bf137 100644 (file)
@@ -23,7 +23,7 @@ with bpy.data.libraries.load(filepath) as (data_from, data_to):
         setattr(data_to, attr, getattr(data_from, attr))
 
 
-# the 'data_to' variables lists are 
+# the 'data_to' variables lists are
 with bpy.data.libraries.load(filepath) as (data_from, data_to):
     data_to.scenes = ["Scene"]
 
index ee7bceedb6ec0b00745805a663faa36f0cac71df..9ec8ee98e4195583ba3142bee3e3f8a230f024d3 100644 (file)
@@ -162,6 +162,7 @@ def edge_loops_from_faces(mesh, faces=None, seams=()):
 
     return edge_loops
 
+
 def edge_loops_from_edges(mesh, edges=None):
     """
     Edge loops defined by edges
@@ -227,8 +228,7 @@ def edge_loops_from_edges(mesh, edges=None):
     return line_polys
 
 
-
-def ngon_tessellate(from_data, indices, fix_loops=True):
+def ngon_tesselate(from_data, indices, fix_loops=True):
     '''
     Takes a polyline of indices (fgon)
     and returns a list of face indicie lists.
@@ -238,7 +238,7 @@ def ngon_tessellate(from_data, indices, fix_loops=True):
     indices: a list of indices to use this list is the ordered closed polyline to fill, and can be a subset of the data given.
     fix_loops: If this is enabled polylines that use loops to make multiple polylines are delt with correctly.
     '''
-    
+
     from mathutils import Vector
     vector_to_tuple = Vector.to_tuple
 
index 7d37b94982fa0e43c7ff05be894b831dee72b644..ef2e20c4908e15de138ede813be49621927bac95 100644 (file)
@@ -45,7 +45,7 @@ def region_2d_to_vector_3d(region, rv3d, coord):
                     ))        
 
         w = (out[0] * persinv[0][3]) + (out[1] * persinv[1][3]) + (out[2] * persinv[2][3]) + persinv[3][3]
-        
+
         return ((out * persinv) / w) - rv3d.view_matrix.inverted()[3].xyz
     else:
         return rv3d.view_matrix.inverted()[2].xyz.normalized()
index 7cd2ee83906a39186cbcac08ac29e4a968fc6787..edd09d9c66b2cee8d5acd16e55019ca1ff9ee1b9 100644 (file)
@@ -26,7 +26,7 @@ import bpy
 
 def extend(obj, operator, EXTEND_MODE):
     from bpy_extras import mesh_utils
-    
+
     me = obj.data
     me_verts = me.vertices
     # script will fail without UVs
index 80f83e7fabefa4b75fa8540bda59a1d23e6f94df..5a0d327f90d1064bd2da09b5dc73b9f8d11ed262 100644 (file)
@@ -44,9 +44,9 @@ class DATA_PT_empty(DataButtonsPanel, bpy.types.Panel):
             # layout.template_image(ob, "data", None)
             layout.template_ID(ob, "data", open="image.open", unlink="image.unlink")
 
-            row = layout.row(align = True)
+            row = layout.row(align=True)
             row.prop(ob, "color", text="Transparency", index=3, slider=True)
-            row = layout.row(align = True)
+            row = layout.row(align=True)
             row.prop(ob, "empty_image_offset", text="Offset X", index=0)
             row.prop(ob, "empty_image_offset", text="Offset Y", index=1)
 
index 2ca18744eb62a7823979a6495e599bf74f662aea..7c2fe76fe1481a9d86b155afcf3e85cb0096308c 100644 (file)
@@ -666,9 +666,9 @@ class ConstraintButtonsPanel():
         row = col.row()
         row.prop(con, "map_to_z_from", expand=False, text="")
         row.label(text=" -> Z")
-        
+
         split = layout.split()
-        
+
         col = split.column()
         col.label(text="Destination:")
         col.row().prop(con, "map_to", expand=True)
index 44a1c814e28ab50d70e2d74f440b8699e831dfff..9f69ca170764e90bf4a0f429879e5721d1c79d58 100644 (file)
@@ -437,7 +437,7 @@ class IMAGE_PT_game_properties(bpy.types.Panel):
         rd = context.scene.render
         sima = context.space_data
         # display even when not in game mode because these settings effect the 3d view
-        return (sima and sima.image)  and (rd.engine == 'BLENDER_GAME')
+        return (sima and sima.image)  # and (rd.engine == 'BLENDER_GAME')
 
     def draw(self, context):
         layout = self.layout