[Bf-blender-cvs] [8c15d612a5c] master: Cleanup: pep8

Campbell Barton noreply at git.blender.org
Tue Jul 3 06:55:21 CEST 2018


Commit: 8c15d612a5cdfe39233c7f2b7556742091c82558
Author: Campbell Barton
Date:   Tue Jul 3 06:47:49 2018 +0200
Branches: master
https://developer.blender.org/rB8c15d612a5cdfe39233c7f2b7556742091c82558

Cleanup: pep8

===================================================================

M	doc/blender_file_format/BlendFileDnaExporter_25.py
M	doc/blender_file_format/BlendFileReader.py
M	doc/manpage/blender.1.py
M	doc/python_api/sphinx_doc_gen.py
M	source/blender/datatoc/datatoc_icon_split.py
M	source/blender/datatoc/datatoc_icon_split_to_png.py
M	source/blender/makesrna/rna_cleanup/rna_cleaner.py
M	source/blender/makesrna/rna_cleanup/rna_cleaner_merge.py
M	source/blender/python/rna_dump.py
M	source/blender/python/simple_enum_gen.py
M	tests/check_deprecated.py
M	tests/python/alembic_tests.py
M	tests/python/bl_alembic_import_test.py
M	tests/python/bl_load_addons.py
M	tests/python/bl_load_py_modules.py
M	tests/python/bl_mesh_modifiers.py
M	tests/python/bl_mesh_validate.py
M	tests/python/bl_pyapi_bpy_utils_units.py
M	tests/python/bl_pyapi_idprop.py
M	tests/python/bl_pyapi_idprop_datablock.py
M	tests/python/bl_pyapi_mathutils.py
M	tests/python/bl_rna_defaults.py
M	tests/python/bl_rna_manual_reference.py
M	tests/python/bl_run_operators.py
M	tests/python/collada/animation/test_animation_simple.py
M	tests/python/collada/mesh/test_mesh_simple.py
M	tests/python/modules/render_report.py
M	tests/python/modules/test_utils.py
M	tests/python/opengl_draw_tests.py
M	tests/python/pep8.py
M	tests/python/rna_array.py

===================================================================

diff --git a/doc/blender_file_format/BlendFileDnaExporter_25.py b/doc/blender_file_format/BlendFileDnaExporter_25.py
index 64c92c7cf80..a9da79f04d8 100755
--- a/doc/blender_file_format/BlendFileDnaExporter_25.py
+++ b/doc/blender_file_format/BlendFileDnaExporter_25.py
@@ -7,7 +7,7 @@
 # as published by the Free Software Foundation; either version 2
 # of the License, or (at your option) any later version.
 #
-# This program is distributed in the hope that it will be useful, 
+# This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
@@ -22,21 +22,21 @@
 #
 #    Name:
 #        dna.py
-#        
+#
 #    Description:
 #        Creates a browsable DNA output to HTML.
-#        
+#
 #    Author:
 #        Jeroen Bakker
-#        
+#
 #    Version:
 #        v0.1 (12-05-2009) - migration of original source code to python.
 #           Added code to support blender 2.5 branch
 #        v0.2 (25-05-2009) - integrated with BlendFileReader.py
-#        
+#
 #    Input:
 #        blender build executable
-#        
+#
 #    Output:
 #        dna.html
 #        dna.css (will only be created when not existing)
@@ -76,12 +76,12 @@ class DNACatalogHTML:
     DNACatalog is a catalog of all information in the DNA1 file-block
     '''
 
-    def __init__(self, catalog, bpy_module = None):
+    def __init__(self, catalog, bpy_module=None):
         self.Catalog = catalog
         self.bpy = bpy_module
-    
+
     def WriteToHTML(self, handle):
-            
+
         dna_html_template = """
             <!DOCTYPE html PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http://www.w3.org/TR/html4/loose.dtd>
             <html>
@@ -105,10 +105,10 @@ class DNACatalogHTML:
                 ${structs_content}
             </body>
             </html>"""
-        
+
         header = self.Catalog.Header
         bpy = self.bpy
-        
+
         # ${version} and ${revision}
         if bpy:
             version = '.'.join(map(str, bpy.app.version))
@@ -116,7 +116,7 @@ class DNACatalogHTML:
         else:
             version = str(header.Version)
             revision = 'Unknown'
-        
+
         # ${bitness}
         if header.PointerSize == 8:
             bitness = '64 bit'
@@ -125,10 +125,10 @@ class DNACatalogHTML:
 
         # ${endianness}
         if header.LittleEndianness:
-            endianess= 'Little endianness'
+            endianess = 'Little endianness'
         else:
-            endianess= 'Big endianness'
-        
+            endianess = 'Big endianness'
+
         # ${structs_list}
         log.debug("Creating structs index")
         structs_list = ''
@@ -136,7 +136,7 @@ class DNACatalogHTML:
         structureIndex = 0
         for structure in self.Catalog.Structs:
             structs_list += list_item.format(structureIndex, structure.Type.Name)
-            structureIndex+=1
+            structureIndex += 1
 
         # ${structs_content}
         log.debug("Creating structs content")
@@ -144,20 +144,20 @@ class DNACatalogHTML:
         for structure in self.Catalog.Structs:
             log.debug(structure.Type.Name)
             structs_content += self.Structure(structure)
-           
+
         d = dict(
-            version = version, 
-            revision = revision, 
-            bitness = bitness, 
-            endianness = endianess, 
-            structs_list = structs_list, 
-            structs_content = structs_content
+            version=version,
+            revision=revision,
+            bitness=bitness,
+            endianness=endianess,
+            structs_list=structs_list,
+            structs_content=structs_content
         )
 
         dna_html = Template(dna_html_template).substitute(d)
         dna_html = self.format(dna_html)
         handle.write(dna_html)
-    
+
     def Structure(self, structure):
         struct_table_template = """
             <table><a name="${struct_name}"></a>
@@ -178,23 +178,23 @@ class DNACatalogHTML:
             </table>
             <label>Total size: ${size} bytes</label><br/>
             <label>(<a href="#top">top</a>)</label><br/>"""
-        
+
         d = dict(
-            struct_name = structure.Type.Name, 
-            fields = self.StructureFields(structure, None, 0), 
-            size = str(structure.Type.Size)
+            struct_name=structure.Type.Name,
+            fields=self.StructureFields(structure, None, 0),
+            size=str(structure.Type.Size)
         )
-        
+
         struct_table = Template(struct_table_template).substitute(d)
         return struct_table
-        
+
     def StructureFields(self, structure, parentReference, offset):
         fields = ''
         for field in structure.Fields:
             fields += self.StructureField(field, structure, parentReference, offset)
             offset += field.Size(self.Catalog.Header)
         return fields
-        
+
     def StructureField(self, field, structure, parentReference, offset):
         structure_field_template = """
             <tr>
@@ -205,7 +205,7 @@ class DNACatalogHTML:
                 <td>${offset}</td>
                 <td>${size}</td>
             </tr>"""
-        
+
         if field.Type.Structure is None or field.Name.IsPointer():
 
             # ${reference}
@@ -216,37 +216,37 @@ class DNACatalogHTML:
                 struct = '<a href="#{0}">{0}</a>'.format(structure.Type.Name)
             else:
                 struct = structure.Type.Name
-            
+
             # ${type}
             type = field.Type.Name
-            
+
             # ${name}
             name = field.Name.Name
-            
+
             # ${offset}
             # offset already set
-            
+
             # ${size}
             size = field.Size(self.Catalog.Header)
-        
+
             d = dict(
-                reference = reference, 
-                struct = struct, 
-                type = type, 
-                name = name, 
-                offset = offset, 
-                size = size
+                reference=reference,
+                struct=struct,
+                type=type,
+                name=name,
+                offset=offset,
+                size=size
             )
-            
+
             structure_field = Template(structure_field_template).substitute(d)
-        
+
         elif field.Type.Structure is not None:
             reference = field.Name.AsReference(parentReference)
-            structure_field = self.StructureFields(field.Type.Structure, reference, offset) 
+            structure_field = self.StructureFields(field.Type.Structure, reference, offset)
 
         return structure_field
 
-    def indent(self, input, dent, startswith = ''):
+    def indent(self, input, dent, startswith=''):
         output = ''
         if dent < 0:
             for line in input.split('\n'):
@@ -257,19 +257,19 @@ class DNACatalogHTML:
                 output += line.lstrip() + '\n'  # remove indentation completely
         elif dent > 0:
             for line in input.split('\n'):
-                output += ' '* dent + line + '\n'
+                output += ' ' * dent + line + '\n'
         return output
-    
+
     def format(self, input):
         diff = {
-            '\n<!DOCTYPE':'<!DOCTYPE', 
-            '\n</ul>'    :'</ul>', 
-            '<a name'         :'\n<a name', 
-            '<tr>\n'     :'<tr>', 
-            '<tr>'       :'  <tr>', 
-            '</th>\n'    :'</th>', 
-            '</td>\n'    :'</td>', 
-            '<tbody>\n'  :'<tbody>'
+            '\n<!DOCTYPE': '<!DOCTYPE',
+            '\n</ul>': '</ul>',
+            '<a name': '\n<a name',
+            '<tr>\n': '<tr>',
+            '<tr>': '  <tr>',
+            '</th>\n': '</th>',
+            '</td>\n': '</td>',
+            '<tbody>\n': '<tbody>'
         }
         output = self.indent(input, 0)
         for key, value in diff.items():
@@ -283,17 +283,17 @@ class DNACatalogHTML:
         '''
         css = """
             @CHARSET "ISO-8859-1";
-            
+
             body {
                 font-family: verdana;
                 font-size: small;
             }
-            
+
             div.title {
                 font-size: large;
                 text-align: center;
             }
-            
+
             h1 {
                 page-break-before: always;
             }
@@ -304,7 +304,7 @@ class DNACatalogHTML:
                 margin-right: 3%;
                 padding-left: 40px;
             }
-            
+
             h1:hover{
                 background-color: #EBEBEB;
             }
@@ -312,7 +312,7 @@ class DNACatalogHTML:
             h3 {
                 padding-left: 40px;
             }
-            
+
             table {
                 border-width: 1px;
                 border-style: solid;
@@ -321,21 +321,21 @@ class DNACatalogHTML:
                 width: 94%;
                 margin: 20px 3% 10px;
             }
-            
+
             caption {
                 margin-bottom: 5px;
             }
-            
+
             th {
                 background-color: #000000;
                 color:#ffffff;
                 padding-left:5px;
                 padding-right:5px;
             }
-            
+
             tr {
             }
-            
+
             td {
                 border-width: 1px;
                 border-style: solid;
@@ -343,12 +343,12 @@ class DNACatalogHTML:
                 padding-left:5px;
                 padding-right:5px;
             }
-            
+
             label {
                 float:right;
                 margin-right: 3%;
             }
-            
+
             ul.multicolumn {
                 list-style:none;
                 float:left;
@@ -361,18 +361,18 @@ class DNACatalogHTML:
                 width:200px;
                 margin-right:0px;
             }
-            
+
             a {
                 color:#a000a0;
                 text-decoration:none;
             }
-            
+
             a:hover {
                 color:#a000a0;
                 text-decoration:underli

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list