add pep8 headers so these scripts spit out errors when running pep8.
authorCampbell Barton <ideasman42@gmail.com>
Sun, 13 Dec 2009 14:38:30 +0000 (14:38 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sun, 13 Dec 2009 14:38:30 +0000 (14:38 +0000)
made some changes but mostly these scripts will give pep8 warnings.

26 files changed:
release/datafiles/datatoc.py
release/getversion.py
release/scripts/io/engine_render_pov.py
release/scripts/io/export_3ds.py
release/scripts/io/export_fbx.py
release/scripts/io/export_mdd.py
release/scripts/io/export_obj.py
release/scripts/io/export_ply.py
release/scripts/io/export_x3d.py
release/scripts/io/import_anim_bvh.py
release/scripts/io/import_scene_3ds.py
release/scripts/io/import_scene_obj.py
release/scripts/modules/console/__init__.py
release/scripts/modules/console/complete_calltip.py
release/scripts/modules/console/complete_import.py
release/scripts/modules/console/complete_namespace.py
release/scripts/modules/console/intellisense.py
release/scripts/op/mesh.py
release/scripts/op/mesh_skin.py
release/scripts/op/presets.py
release/scripts/op/uvcalc_smart_project.py
release/scripts/op/vertexpaint_dirt.py
release/scripts/ui/space_dopesheet.py
release/scripts/ui/space_graph.py
release/scripts/ui/space_nla.py
release/test/rna_array.py

index a78b64c5095a3cc92fbfa13ecea7a4946a1ce04d..8a0e5290cb5f7324396f1ec1adf8f547f5c02440 100755 (executable)
 #
 # ***** END GPL LICENCE BLOCK *****
 
-import sys, os
+# <pep8 compliant>
+
+import sys
+import os
 
 if len(sys.argv) < 2:
     sys.stdout.write("Usage: datatoc <data_file>\n")
@@ -33,7 +36,7 @@ if len(sys.argv) < 2:
 filename = sys.argv[1]
 
 try:
-    fpin = open(filename, "rb");
+    fpin = open(filename, "rb")
 except:
     sys.stdout.write("Unable to open input %s\n" % sys.argv[1])
     sys.exit(1)
index fd52129bf4a2d59922186f2d0c1b95024b922876..a9bf3b1d04ee6d80ddc067e868d68aab6bfda980 100755 (executable)
 # The Original Code is: see repository.
 #
 # Contributor(s): see repository.
-#
-import sys, os, re
 
-nanblenderhome = os.getenv("NANBLENDERHOME");
+# <pep8-80 compliant>
+
+import sys
+import os
+import re
+
+nanblenderhome = os.getenv("NANBLENDERHOME")
 
 if nanblenderhome == None:
-       nanblenderhome = os.path.dirname(os.path.abspath(sys.argv[0]))+"/.."    
+    nanblenderhome = os.path.dirname(os.path.abspath(sys.argv[0])) + "/.."
 
-config = nanblenderhome+"/source/blender/blenkernel/BKE_blender.h"
+config = nanblenderhome + "/source/blender/blenkernel/BKE_blender.h"
 
 infile = open(config)
 
@@ -40,23 +44,23 @@ major = None
 minor = None
 
 for line in infile.readlines():
-       m = re.search("#define BLENDER_VERSION\s+(\d+)", line)
-       if m:
-               major =  m.group(1)
-       m = re.search("#define BLENDER_SUBVERSION\s+(\d+)", line)
-       if m:
-               minor = m.group(1)
-       if minor and major:
-               major = float(major) / 100.0
-               break
+    m = re.search("#define BLENDER_VERSION\s+(\d+)", line)
+    if m:
+        major = m.group(1)
+    m = re.search("#define BLENDER_SUBVERSION\s+(\d+)", line)
+    if m:
+        minor = m.group(1)
+    if minor and major:
+        major = float(major) / 100.0
+        break
 
 infile.close()
 
 # Major was changed to float, but minor is still a string
 if minor and major:
-       if minor == "0":
-               print "%.2f" % major
-       else:
-               print "%.2f.%s" % (major, minor)
+    if minor == "0":
+        print "%.2f" % major
+    else:
+        print "%.2f.%s" % (major, minor)
 else:
-       print "unknownversion"
+    print "unknownversion"
index adff98ce9c45ba0235a37f228bb4272c2a844fdf..d5f02fa3b6aa09ecb9a365124e46029bdba9bd23 100644 (file)
@@ -16,6 +16,8 @@
 #
 # ##### END GPL LICENSE BLOCK #####
 
+# <pep8 compliant>
+
 import bpy
 
 from math import atan, pi, degrees
index ad8ffac1147f3faf5f5f3b769a8f2d5fee950dfa..edbb80b0272bb4e2f7e68816e2037dfe8ed8751a 100644 (file)
@@ -17,6 +17,8 @@
 #
 # ##### END GPL LICENSE BLOCK #####
 
+# <pep8 compliant>
+
 __author__ = ["Campbell Barton", "Bob Holcomb", "Richard Lärkäng", "Damien McGinnes", "Mark Stijnman"]
 __url__ = ("blenderartists.org", "www.blender.org", "www.gametutorials.com", "lib3ds.sourceforge.net/")
 __version__ = "0.90a"
index e0a0367f18e821faa5290698a6183552c9dd2649..97af4cb6ebf4c21e194dd30f8310265792032311 100644 (file)
@@ -16,6 +16,8 @@
 #
 # ##### END GPL LICENSE BLOCK #####
 
+# <pep8 compliant>
+
 __author__ = "Campbell Barton"
 __url__ = ['www.blender.org', 'blenderartists.org']
 __version__ = "1.2"
index 98d87ef6a7fe217e200300eed8760ca2ccfb5788..fc85b2996d025423363dce06458d83c10adee8b4 100644 (file)
@@ -16,6 +16,8 @@
 #
 # ##### END GPL LICENSE BLOCK #####
 
+# <pep8 compliant>
+
 __author__ = "Bill L.Nieuwendorp"
 __bpydoc__ = """\
 This script Exports Lightwaves MotionDesigner format.
index 37ade1213117a7cbb1b14f44eb538fcd141538d0..d6026d10ba9c02f95bb1d18ba8f4b13142dc5046 100644 (file)
@@ -16,6 +16,8 @@
 #
 # ##### END GPL LICENSE BLOCK #####
 
+# <pep8 compliant>
+
 """
 Name: 'Wavefront (.obj)...'
 Blender: 248
index f2cf04ae792868b66fbe1e9e185009ce88f9a4cf..ed85c7fc6d92134c6e4b78f68611a4e9ec8d4cd5 100644 (file)
@@ -16,6 +16,8 @@
 #
 # ##### END GPL LICENSE BLOCK #####
 
+# <pep8 compliant>
+
 import bpy
 
 __author__ = "Bruce Merry"
index 969c4cf0752003d155d1b54874127be1a215069d..6cfe0f4562623a41851d96e4012e1ecfce238650 100644 (file)
@@ -16,6 +16,8 @@
 #
 # ##### END GPL LICENSE BLOCK #####
 
+# <pep8 compliant>
+
 __author__ = ("Bart", "Campbell Barton")
 __email__ = ["Bart, bart:neeneenee*de"]
 __url__ = ["Author's (Bart) homepage, http://www.neeneenee.de/vrml"]
index a7e621a61a72bec0411bc8d77d31feda60efad69..a8fe887b950e63efaabf4f712ac0fd79abbbab55 100644 (file)
@@ -1,3 +1,23 @@
+# ##### BEGIN GPL LICENSE BLOCK #####
+#
+#  This program is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU General Public License
+#  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,
+#  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.
+#
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, write to the Free Software Foundation,
+#  Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+#
+# ##### END GPL LICENSE BLOCK #####
+
+# <pep8 compliant>
+
 import math
 
 # import Blender
index 6255c80b3a3078761519557e22fecbe02b2fe02c..4744c5df01a769093be954b99303d1b16ca46091 100644 (file)
@@ -16,6 +16,8 @@
 #
 # ##### END GPL LICENSE BLOCK #####
 
+# <pep8 compliant>
+
 __author__= ['Bob Holcomb', 'Richard L?rk?ng', 'Damien McGinnes', 'Campbell Barton', 'Mario Lapin']
 __url__ = ("blenderartists.org", "www.blender.org", "www.gametutorials.com", "lib3ds.sourceforge.net/")
 __version__= '0.996'
index a94e0f5e22dbbe382eb8b26f234d0af60ef84561..cbd2b831e55bfce7002ccdbf59f15f8e0376b412 100644 (file)
@@ -16,6 +16,8 @@
 #
 # ##### END GPL LICENSE BLOCK #####
 
+# <pep8 compliant>
+
 __author__= "Campbell Barton", "Jiri Hnidek", "Paolo Ciccone"
 __url__= ['http://wiki.blender.org/index.php/Scripts/Manual/Import/wavefront_obj', 'blender.org', 'blenderartists.org']
 __version__= "2.11"
index eb32d78b1efce5c02be6b968c1aa8f355470fd8b..efd2ed85accc40b173eb6bf437849eada1ad1139 100644 (file)
@@ -13,4 +13,6 @@
 # You should have received a copy of the GNU Lesser General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+# <pep8 compliant>
+
 """Package for console specific modules."""
index 486f9469d605b57eb6b496cde8a7c0d1ec1cd5da..c4687b4f10b61814b5f257dc774542e596877128 100644 (file)
@@ -13,6 +13,8 @@
 # You should have received a copy of the GNU Lesser General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+# <pep8-80 compliant>
+
 import inspect
 import re
 
index 65a507b349d0c414dbd025458cc26d45dc25ea14..875c557f497c561bf0daa39eea7595c8b93fee0f 100644 (file)
@@ -21,6 +21,8 @@
 #  the file COPYING, distributed as part of this software.
 #*****************************************************************************
 
+# <pep8 compliant>
+
 """Completer for import statements
 
 Original code was from IPython/Extensions/ipy_completers.py. The following
index 4aa0de558f23f2cf9abf5bc32d627b679dd84c7c..7a9fd331e4912861356d81bb03863ad097e7ae7c 100644 (file)
@@ -13,6 +13,8 @@
 # You should have received a copy of the GNU Lesser General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+# <pep8-80 compliant>
+
 """Autocomplete with the standard library"""
 
 import re
index 686b3e7294bf8ef00cb9129c4a89b78cb0e86a76..96896d5fd0e15e0a3fd162d4c5c4e90fae7f5303 100644 (file)
@@ -13,6 +13,8 @@
 # You should have received a copy of the GNU Lesser General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+# <pep8-80 compliant>
+
 """This module provides intellisense features such as:
 
 * autocompletion
index 0e57bc440d10a780a8310c33a8a8e0245a4b7e9f..6ca03b409f092527ed5206abd1f236a1344c0357 100644 (file)
@@ -16,6 +16,8 @@
 #
 # ##### END GPL LICENSE BLOCK #####
 
+# <pep8-80 compliant>
+
 import bpy
 
 def main(context):
index 5cf526cc23ed74298fc87380046d595391087183..436cd21c9eecde7591b3ead72f56fb03943a9714 100644 (file)
@@ -16,6 +16,8 @@
 #
 # ##### END GPL LICENSE BLOCK #####
 
+# <pep8 compliant>
+
 # import Blender
 import time, functools
 import bpy
index 0ce19f712ab0b5028255d77e4710363ed9cc2f8e..0f6d5e11b5c02fbdb3a9d1f2e8005a0a8de418b2 100644 (file)
 #
 # ##### END GPL LICENSE BLOCK #####
 
+# <pep8 compliant>
+
 import bpy
 import os
 
+
 class AddPresetBase(bpy.types.Operator):
     '''Base preset class, only for subclassing
     subclasses must define
@@ -27,7 +30,7 @@ class AddPresetBase(bpy.types.Operator):
     bl_idname = "render.preset_add"
     bl_label = "Add Render Preset"
 
-    name = bpy.props.StringProperty(name="Name", description="Name of the preset, used to make the path name", maxlen= 64, default= "")
+    name = bpy.props.StringProperty(name="Name", description="Name of the preset, used to make the path name", maxlen=64, default="")
 
     def _as_filename(self, name): # could reuse for other presets
         for char in " !@#$%^&*(){}:\";'[]<>,./?":
@@ -104,6 +107,7 @@ class AddPresetSSS(AddPresetBase):
 
     preset_subdir = "sss"
 
+
 class AddPresetCloth(AddPresetBase):
     '''Add a Cloth Preset.'''
     bl_idname = "cloth.preset_add"
@@ -124,4 +128,3 @@ class AddPresetCloth(AddPresetBase):
 bpy.ops.add(AddPresetRender)
 bpy.ops.add(AddPresetSSS)
 bpy.ops.add(AddPresetCloth)
-
index 2da7174ed99ababeaa201edc31656fe0c0ce288b..0dd1f8b1e083e60a69a8321b5f25ef5656eb1307 100644 (file)
@@ -20,6 +20,7 @@
 # ***** END GPL LICENCE BLOCK *****
 # --------------------------------------------------------------------------
 
+# <pep8 compliant>
 
 #from Blender import Object, Draw, Window, sys, Mesh, Geometry
 from Mathutils import Matrix, Vector, RotationMatrix
index 585a2231e21ae10432046c831f7d92d7b6002747..b4b30fed06f03c68cd105c8d055e8461d28b82e5 100644 (file)
@@ -19,6 +19,8 @@
 # ***** END GPL LICENCE BLOCK *****
 # --------------------------------------------------------------------------
 
+# <pep8 compliant>
+
 # History
 #
 # Originally written by Campbell Barton aka ideasman42
index f9381432e2718a603162a1c38f6e2e1c847d3e7a..4710d9de3aa6fe699f85d82d598a99ebd356d1ca 100644 (file)
@@ -16,6 +16,8 @@
 #
 # ##### END GPL LICENSE BLOCK #####
 
+# <pep8 compliant>
+
 import bpy
 
 
index 57e42f9d48c7226858e3eb8bd31be7e2b38fbaf4..d97fa2bfeed7dae6ac3e8b87bcb5b6b1a9195c31 100644 (file)
@@ -16,6 +16,8 @@
 #
 # ##### END GPL LICENSE BLOCK #####
 
+# <pep8 compliant>
+
 import bpy
 
 
index 622ebb42ab7078485882c68cf7ba1f4aece2c389..285ada5f46eef482cdfcb24ba07f15ed1500f527 100644 (file)
@@ -16,6 +16,8 @@
 #
 # ##### END GPL LICENSE BLOCK #####
 
+# <pep8 compliant>
+
 import bpy
 
 
index 08aea1c7967bff1a6f162c28340f9b47aed587ae..6c6539f55096222e34ab7d79399b9f24e40b642c 100644 (file)
@@ -16,6 +16,8 @@
 #
 # ##### END GPL LICENSE BLOCK #####
 
+# <pep8 compliant>
+
 import unittest
 import random
 
@@ -29,269 +31,269 @@ test= bpy.data.test
 # same as above for other types except that the first letter is "i" for int and "b" for bool
 
 class TestArray(unittest.TestCase):
-       # test that assignment works by: assign -> test value
-       # - rvalue = list of float
-       # - rvalue = list of numbers
-       # test.object
-       # bpy.data.test.farr[3], iarr[3], barr[...], fmarr, imarr, bmarr
-
-       def setUp(self):
-               test.farr= (1.0, 2.0, 3.0)
-               test.iarr= (7, 8, 9)
-               test.barr= (False, True, False)
-       
-       # test access
-       # test slice access, negative indices
-       def test_access(self):
-               rvals= ([1.0, 2.0, 3.0], [7, 8, 9], [False, True, False])
-               for arr, rval in zip((test.farr, test.iarr, test.barr), rvals):
-                       self.assertEqual(prop_to_list(arr), rval)
-                       self.assertEqual(arr[0:3], rval)
-                       self.assertEqual(arr[1:2], rval[1:2])
-                       self.assertEqual(arr[-1], arr[2])
-                       self.assertEqual(arr[-2], arr[1])
-                       self.assertEqual(arr[-3], arr[0])
-
-       # fail when index out of bounds
-       def test_access_fail(self):
-               for arr in (test.farr, test.iarr, test.barr):
-                       self.assertRaises(IndexError, lambda : arr[4])
-       
-       # test assignment of a whole array
-       def test_assign_array(self):
-               # should accept int as float
-               test.farr= (1, 2, 3)
-
-       # fail when: unexpected no. of items, invalid item type
-       def test_assign_array_fail(self):
-               def assign_empty_list(arr):
-                       setattr(test, arr, ())
-
-               for arr in ("farr", "iarr", "barr"):
-                       self.assertRaises(ValueError, assign_empty_list, arr)
-
-               def assign_invalid_float():
-                       test.farr= (1.0, 2.0, "3.0")
-
-               def assign_invalid_int():
-                       test.iarr= ("1", 2, 3)
-
-               def assign_invalid_bool():
-                       test.barr= (True, 0.123, False)
-
-               for func in [assign_invalid_float, assign_invalid_int, assign_invalid_bool]:
-                       self.assertRaises(TypeError, func)
-
-               # shouldn't accept float as int
-               def assign_float_as_int():
-                       test.iarr= (1, 2, 3.0)
-               self.assertRaises(TypeError, assign_float_as_int)
-
-               # non-dynamic arrays cannot change size
-               def assign_different_size(arr, val):
-                       setattr(test, arr, val)
-               for arr, val in zip(("iarr", "farr", "barr"), ((1, 2), (1.0, 2.0), (True, False))):
-                       self.assertRaises(ValueError, assign_different_size, arr, val)
-
-       # test assignment of specific items
-       def test_assign_item(self):
-               for arr, rand_func in zip((test.farr, test.iarr, test.barr), (rand_float, rand_int, rand_bool)):
-                       for i in range(len(arr)):
-                               val= rand_func()
-                               arr[i]= val
-                               
-                               self.assertEqual(arr[i], val)
-
-               # float prop should accept also int
-               for i in range(len(test.farr)):
-                       val= rand_int()
-                       test.farr[i]= val
-                       self.assertEqual(test.farr[i], float(val))
-
-               
-
-       def test_assign_item_fail(self):
-               def assign_bad_index(arr):
-                       arr[4] = 1.0
-
-               def assign_bad_type(arr):
-                       arr[1]= "123"
-                       
-               for arr in [test.farr, test.iarr, test.barr]:
-                       self.assertRaises(IndexError, assign_bad_index, arr)
-
-               # not testing bool because bool allows not only (True|False)
-               for arr in [test.farr, test.iarr]:      
-                       self.assertRaises(TypeError, assign_bad_type, arr)
-
-       def test_dynamic_assign_array(self):
-               # test various lengths here
-               for arr, rand_func in zip(("fdarr", "idarr", "bdarr"), (rand_float, rand_int, rand_bool)):
-                       for length in range(1, 64):
-                               rval= make_random_array(length, rand_func)
-                               setattr(test, arr, rval)
-                               self.assertEqual(prop_to_list(getattr(test, arr)), rval)
-
-       def test_dynamic_assign_array_fail(self):
-               # could also test too big length here
-               
-               def assign_empty_list(arr):
-                       setattr(test, arr, ())
-
-               for arr in ("fdarr", "idarr", "bdarr"):
-                       self.assertRaises(ValueError, assign_empty_list, arr)
+    # test that assignment works by: assign -> test value
+    # - rvalue = list of float
+    # - rvalue = list of numbers
+    # test.object
+    # bpy.data.test.farr[3], iarr[3], barr[...], fmarr, imarr, bmarr
+
+    def setUp(self):
+        test.farr= (1.0, 2.0, 3.0)
+        test.iarr= (7, 8, 9)
+        test.barr= (False, True, False)
+    
+    # test access
+    # test slice access, negative indices
+    def test_access(self):
+        rvals= ([1.0, 2.0, 3.0], [7, 8, 9], [False, True, False])
+        for arr, rval in zip((test.farr, test.iarr, test.barr), rvals):
+            self.assertEqual(prop_to_list(arr), rval)
+            self.assertEqual(arr[0:3], rval)
+            self.assertEqual(arr[1:2], rval[1:2])
+            self.assertEqual(arr[-1], arr[2])
+            self.assertEqual(arr[-2], arr[1])
+            self.assertEqual(arr[-3], arr[0])
+
+    # fail when index out of bounds
+    def test_access_fail(self):
+        for arr in (test.farr, test.iarr, test.barr):
+            self.assertRaises(IndexError, lambda : arr[4])
+    
+    # test assignment of a whole array
+    def test_assign_array(self):
+        # should accept int as float
+        test.farr= (1, 2, 3)
+
+    # fail when: unexpected no. of items, invalid item type
+    def test_assign_array_fail(self):
+        def assign_empty_list(arr):
+            setattr(test, arr, ())
+
+        for arr in ("farr", "iarr", "barr"):
+            self.assertRaises(ValueError, assign_empty_list, arr)
+
+        def assign_invalid_float():
+            test.farr= (1.0, 2.0, "3.0")
+
+        def assign_invalid_int():
+            test.iarr= ("1", 2, 3)
+
+        def assign_invalid_bool():
+            test.barr= (True, 0.123, False)
+
+        for func in [assign_invalid_float, assign_invalid_int, assign_invalid_bool]:
+            self.assertRaises(TypeError, func)
+
+        # shouldn't accept float as int
+        def assign_float_as_int():
+            test.iarr= (1, 2, 3.0)
+        self.assertRaises(TypeError, assign_float_as_int)
+
+        # non-dynamic arrays cannot change size
+        def assign_different_size(arr, val):
+            setattr(test, arr, val)
+        for arr, val in zip(("iarr", "farr", "barr"), ((1, 2), (1.0, 2.0), (True, False))):
+            self.assertRaises(ValueError, assign_different_size, arr, val)
+
+    # test assignment of specific items
+    def test_assign_item(self):
+        for arr, rand_func in zip((test.farr, test.iarr, test.barr), (rand_float, rand_int, rand_bool)):
+            for i in range(len(arr)):
+                val= rand_func()
+                arr[i]= val
+                
+                self.assertEqual(arr[i], val)
+
+        # float prop should accept also int
+        for i in range(len(test.farr)):
+            val= rand_int()
+            test.farr[i]= val
+            self.assertEqual(test.farr[i], float(val))
+
+        # 
+
+    def test_assign_item_fail(self):
+        def assign_bad_index(arr):
+            arr[4] = 1.0
+
+        def assign_bad_type(arr):
+            arr[1]= "123"
+            
+        for arr in [test.farr, test.iarr, test.barr]:
+            self.assertRaises(IndexError, assign_bad_index, arr)
+
+        # not testing bool because bool allows not only (True|False)
+        for arr in [test.farr, test.iarr]:    
+            self.assertRaises(TypeError, assign_bad_type, arr)
+
+    def test_dynamic_assign_array(self):
+        # test various lengths here
+        for arr, rand_func in zip(("fdarr", "idarr", "bdarr"), (rand_float, rand_int, rand_bool)):
+            for length in range(1, 64):
+                rval= make_random_array(length, rand_func)
+                setattr(test, arr, rval)
+                self.assertEqual(prop_to_list(getattr(test, arr)), rval)
+
+    def test_dynamic_assign_array_fail(self):
+        # could also test too big length here
+        
+        def assign_empty_list(arr):
+            setattr(test, arr, ())
+
+        for arr in ("fdarr", "idarr", "bdarr"):
+            self.assertRaises(ValueError, assign_empty_list, arr)
 
 
 class TestMArray(unittest.TestCase):
-       def setUp(self):
-               # reset dynamic array sizes
-               for arr, func in zip(("fdmarr", "idmarr", "bdmarr"), (rand_float, rand_int, rand_bool)):
-                       setattr(test, arr, make_random_3d_array((3, 4, 5), func))
+    def setUp(self):
+        # reset dynamic array sizes
+        for arr, func in zip(("fdmarr", "idmarr", "bdmarr"), (rand_float, rand_int, rand_bool)):
+            setattr(test, arr, make_random_3d_array((3, 4, 5), func))
 
-       # test assignment
-       def test_assign_array(self):
-               for arr, func in zip(("fmarr", "imarr", "bmarr"), (rand_float, rand_int, rand_bool)):
-                       # assignment of [3][4][5]
-                       rval= make_random_3d_array((3, 4, 5), func)
-                       setattr(test, arr, rval)
-                       self.assertEqual(prop_to_list(getattr(test, arr)), rval)
+    # test assignment
+    def test_assign_array(self):
+        for arr, func in zip(("fmarr", "imarr", "bmarr"), (rand_float, rand_int, rand_bool)):
+            # assignment of [3][4][5]
+            rval= make_random_3d_array((3, 4, 5), func)
+            setattr(test, arr, rval)
+            self.assertEqual(prop_to_list(getattr(test, arr)), rval)
 
-               # test assignment of [2][4][5], [1][4][5] should work on dynamic arrays
+        # test assignment of [2][4][5], [1][4][5] should work on dynamic arrays
 
-       def test_assign_array_fail(self):
-               def assign_empty_array():
-                       test.fmarr= ()
-               self.assertRaises(ValueError, assign_empty_array)
+    def test_assign_array_fail(self):
+        def assign_empty_array():
+            test.fmarr= ()
+        self.assertRaises(ValueError, assign_empty_array)
 
-               def assign_invalid_size(arr, rval):
-                       setattr(test, arr, rval)
+        def assign_invalid_size(arr, rval):
+            setattr(test, arr, rval)
 
-               # assignment of 3,4,4 or 3,3,5 should raise ex
-               for arr, func in zip(("fmarr", "imarr", "bmarr"), (rand_float, rand_int, rand_bool)):
-                       rval= make_random_3d_array((3, 4, 4), func)
-                       self.assertRaises(ValueError, assign_invalid_size, arr, rval)
+        # assignment of 3,4,4 or 3,3,5 should raise ex
+        for arr, func in zip(("fmarr", "imarr", "bmarr"), (rand_float, rand_int, rand_bool)):
+            rval= make_random_3d_array((3, 4, 4), func)
+            self.assertRaises(ValueError, assign_invalid_size, arr, rval)
 
-                       rval= make_random_3d_array((3, 3, 5), func)
-                       self.assertRaises(ValueError, assign_invalid_size, arr, rval)
+            rval= make_random_3d_array((3, 3, 5), func)
+            self.assertRaises(ValueError, assign_invalid_size, arr, rval)
 
-                       rval= make_random_3d_array((3, 3, 3), func)
-                       self.assertRaises(ValueError, assign_invalid_size, arr, rval)
+            rval= make_random_3d_array((3, 3, 3), func)
+            self.assertRaises(ValueError, assign_invalid_size, arr, rval)
 
-       def test_assign_item(self):
-               # arr[i] = x
-               for arr, func in zip(("fmarr", "imarr", "bmarr", "fdmarr", "idmarr", "bdmarr"), (rand_float, rand_int, rand_bool) * 2):
-                       rval= make_random_2d_array((4, 5), func)
+    def test_assign_item(self):
+        # arr[i] = x
+        for arr, func in zip(("fmarr", "imarr", "bmarr", "fdmarr", "idmarr", "bdmarr"), (rand_float, rand_int, rand_bool) * 2):
+            rval= make_random_2d_array((4, 5), func)
 
-                       for i in range(3):
-                               getattr(test, arr)[i]= rval
-                               self.assertEqual(prop_to_list(getattr(test, arr)[i]), rval)
+            for i in range(3):
+                getattr(test, arr)[i]= rval
+                self.assertEqual(prop_to_list(getattr(test, arr)[i]), rval)
 
-               # arr[i][j] = x
-               for arr, func in zip(("fmarr", "imarr", "bmarr", "fdmarr", "idmarr", "bdmarr"), (rand_float, rand_int, rand_bool) * 2):
+        # arr[i][j] = x
+        for arr, func in zip(("fmarr", "imarr", "bmarr", "fdmarr", "idmarr", "bdmarr"), (rand_float, rand_int, rand_bool) * 2):
 
-                       arr= getattr(test, arr)
-                       rval= make_random_array(5, func)
+            arr= getattr(test, arr)
+            rval= make_random_array(5, func)
 
-                       for i in range(3):
-                               for j in range(4):
-                                       arr[i][j]= rval
-                                       self.assertEqual(prop_to_list(arr[i][j]), rval)
+            for i in range(3):
+                for j in range(4):
+                    arr[i][j]= rval
+                    self.assertEqual(prop_to_list(arr[i][j]), rval)
 
 
-       def test_assign_item_fail(self):
-               def assign_wrong_size(arr, i, rval):
-                       getattr(test, arr)[i]= rval
+    def test_assign_item_fail(self):
+        def assign_wrong_size(arr, i, rval):
+            getattr(test, arr)[i]= rval
 
-               # assign wrong size at level 2
-               for arr, func in zip(("fmarr", "imarr", "bmarr"), (rand_float, rand_int, rand_bool)):
-                       rval1= make_random_2d_array((3, 5), func)
-                       rval2= make_random_2d_array((4, 3), func)
+        # assign wrong size at level 2
+        for arr, func in zip(("fmarr", "imarr", "bmarr"), (rand_float, rand_int, rand_bool)):
+            rval1= make_random_2d_array((3, 5), func)
+            rval2= make_random_2d_array((4, 3), func)
 
-                       for i in range(3):
-                               self.assertRaises(ValueError, assign_wrong_size, arr, i, rval1)
-                               self.assertRaises(ValueError, assign_wrong_size, arr, i, rval2)
+            for i in range(3):
+                self.assertRaises(ValueError, assign_wrong_size, arr, i, rval1)
+                self.assertRaises(ValueError, assign_wrong_size, arr, i, rval2)
 
-       def test_dynamic_assign_array(self):
-               for arr, func in zip(("fdmarr", "idmarr", "bdmarr"), (rand_float, rand_int, rand_bool)):
-                       # assignment of [3][4][5]
-                       rval= make_random_3d_array((3, 4, 5), func)
-                       setattr(test, arr, rval)
-                       self.assertEqual(prop_to_list(getattr(test, arr)), rval)
+    def test_dynamic_assign_array(self):
+        for arr, func in zip(("fdmarr", "idmarr", "bdmarr"), (rand_float, rand_int, rand_bool)):
+            # assignment of [3][4][5]
+            rval= make_random_3d_array((3, 4, 5), func)
+            setattr(test, arr, rval)
+            self.assertEqual(prop_to_list(getattr(test, arr)), rval)
 
-                       # [2][4][5]
-                       rval= make_random_3d_array((2, 4, 5), func)
-                       setattr(test, arr, rval)
-                       self.assertEqual(prop_to_list(getattr(test, arr)), rval)
+            # [2][4][5]
+            rval= make_random_3d_array((2, 4, 5), func)
+            setattr(test, arr, rval)
+            self.assertEqual(prop_to_list(getattr(test, arr)), rval)
 
-                       # [1][4][5]
-                       rval= make_random_3d_array((1, 4, 5), func)
-                       setattr(test, arr, rval)
-                       self.assertEqual(prop_to_list(getattr(test, arr)), rval)
+            # [1][4][5]
+            rval= make_random_3d_array((1, 4, 5), func)
+            setattr(test, arr, rval)
+            self.assertEqual(prop_to_list(getattr(test, arr)), rval)
 
 
-       # test access
-       def test_access(self):
-               pass
+    # test access
+    def test_access(self):
+        pass
 
-       # test slice access, negative indices
-       def test_access_fail(self):
-               pass
+    # test slice access, negative indices
+    def test_access_fail(self):
+        pass
 
 random.seed()
 
 def rand_int():
-       return random.randint(-1000, 1000)
+    return random.randint(-1000, 1000)
 
 def rand_float():
-       return float(rand_int())
+    return float(rand_int())
 
 def rand_bool():
-       return bool(random.randint(0, 1))
+    return bool(random.randint(0, 1))
 
 def make_random_array(len, rand_func):
-       arr= []
-       for i in range(len):
-               arr.append(rand_func())
-               
-       return arr
+    arr= []
+    for i in range(len):
+        arr.append(rand_func())
+        
+    return arr
 
 def make_random_2d_array(dimsize, rand_func):
-       marr= []
-       for i in range(dimsize[0]):
-               marr.append([])
+    marr= []
+    for i in range(dimsize[0]):
+        marr.append([])
 
-               for j in range(dimsize[1]):
-                       marr[-1].append(rand_func())
+        for j in range(dimsize[1]):
+            marr[-1].append(rand_func())
 
-       return marr
+    return marr
 
 def make_random_3d_array(dimsize, rand_func):
-       marr= []
-       for i in range(dimsize[0]):
-               marr.append([])
+    marr= []
+    for i in range(dimsize[0]):
+        marr.append([])
 
-               for j in range(dimsize[1]):
-                       marr[-1].append([])
+        for j in range(dimsize[1]):
+            marr[-1].append([])
 
-                       for k in range(dimsize[2]):
-                               marr[-1][-1].append(rand_func())
+            for k in range(dimsize[2]):
+                marr[-1][-1].append(rand_func())
 
-       return marr
+    return marr
 
 def prop_to_list(prop):
-       ret= []
+    ret= []
 
-       for x in prop:
-               if type(x) not in (bool, int, float):
-                       ret.append(prop_to_list(x))
-               else:
-                       ret.append(x)
+    for x in prop:
+        if type(x) not in (bool, int, float):
+            ret.append(prop_to_list(x))
+        else:
+            ret.append(x)
 
-       return ret
+    return ret
 
 def suite():
-       return unittest.TestSuite([unittest.TestLoader().loadTestsFromTestCase(TestArray), unittest.TestLoader().loadTestsFromTestCase(TestMArray)])
+    return unittest.TestSuite([unittest.TestLoader().loadTestsFromTestCase(TestArray), unittest.TestLoader().loadTestsFromTestCase(TestMArray)])
 
 if __name__ == "__main__":
-       unittest.TextTestRunner(verbosity=2).run(suite())
+    unittest.TextTestRunner(verbosity=2).run(suite())