Names of functions were changed, according to the "Style Guide for Python Code"
authorClemens Barth <barth@root-1.de>
Thu, 8 Nov 2012 23:33:06 +0000 (23:33 +0000)
committerClemens Barth <barth@root-1.de>
Thu, 8 Nov 2012 23:33:06 +0000 (23:33 +0000)
http://www.python.org/dev/peps/pep-0008/

Blendphys

io_atomblend_utilities/__init__.py
io_atomblend_utilities/io_atomblend_utilities.py

index eac695b67bc3ed49174f0dfd38208af18cd88a88..0b0c1cb31d89f1fd8a2059336033d3f4fa814f6f 100644 (file)
@@ -24,7 +24,7 @@
 #
 #  Start of project              : 2011-12-01 by Clemens Barth
 #  First publication in Blender  : 2012-11-03
-#  Last modified                 : 2012-11-08
+#  Last modified                 : 2012-11-09
 #
 #  Acknowledgements 
 #  ================
@@ -126,13 +126,13 @@ class PanelProperties(bpy.types.PropertyGroup):
 
     def Callback_radius_type(self, context):
         scn = bpy.context.scene.atom_blend[0]
-        io_atomblend_utilities.DEF_atom_blend_radius_type(
+        io_atomblend_utilities.radius_type(
                 scn.radius_type,
                 scn.radius_how,)
 
     def Callback_radius_pm(self, context):
         scn = bpy.context.scene.atom_blend[0]
-        io_atomblend_utilities.DEF_atom_blend_radius_pm(
+        io_atomblend_utilities.radius_pm(
                 scn.radius_pm_name,
                 scn.radius_pm,
                 scn.radius_how,)
@@ -187,7 +187,7 @@ class DatafileApply(Operator):
         if scn.datafile == "":
             return {'FINISHED'}
 
-        io_atomblend_utilities.DEF_atom_blend_custom_datafile(scn.datafile)
+        io_atomblend_utilities.custom_datafile(scn.datafile)
 
         for obj in bpy.context.selected_objects:
             if len(obj.children) != 0:
@@ -304,7 +304,7 @@ class DistanceButton(Operator):
 
     def execute(self, context):
         scn  = bpy.context.scene.atom_blend[0]
-        dist = io_atomblend_utilities.DEF_atom_blend_distance()
+        dist = io_atomblend_utilities.distance()
 
         if dist != "N.A.":
             # The string length is cut, 3 digits after the first 3 digits
@@ -327,7 +327,7 @@ class RadiusAllBiggerButton(Operator):
 
     def execute(self, context):
         scn = bpy.context.scene.atom_blend[0]
-        io_atomblend_utilities.DEF_atom_blend_radius_all(
+        io_atomblend_utilities.radius_all(
                 scn.radius_all,
                 scn.radius_how,
                 )
@@ -342,7 +342,7 @@ class RadiusAllSmallerButton(Operator):
 
     def execute(self, context):
         scn = bpy.context.scene.atom_blend[0]
-        io_atomblend_utilities.DEF_atom_blend_radius_all(
+        io_atomblend_utilities.radius_all(
                 1.0/scn.radius_all,
                 scn.radius_how,
                 )
@@ -352,7 +352,7 @@ class RadiusAllSmallerButton(Operator):
 
 
 def register():
-    io_atomblend_utilities.DEF_atom_blend_read_elements()  
+    io_atomblend_utilities.read_elements()  
     bpy.utils.register_module(__name__)
     bpy.types.Scene.atom_blend = bpy.props.CollectionProperty(type=
                                                    PanelProperties)
index 66eed966dd62af7bb924ca748f8766731e57c344..4654e1dc32feb317be74887a71462599a2a5e7d2 100644 (file)
@@ -180,7 +180,7 @@ class ElementProp(object):
 
 # This function measures the distance between two objects (atoms),
 # which are active.
-def DEF_atom_blend_distance():
+def distance():
 
     if len(bpy.context.selected_bases) > 1:
         object_1 = bpy.context.selected_objects[0]
@@ -197,7 +197,7 @@ def DEF_atom_blend_distance():
 #        pre-defined, atomic or van der Waals
 #
 # Explanations here are also valid for the next 3 DEFs.
-def DEF_atom_blend_radius_type(rtype,how):
+def radius_type(rtype,how):
 
     if how == "ALL_IN_LAYER":
 
@@ -242,7 +242,7 @@ def DEF_atom_blend_radius_type(rtype,how):
 
 
 # Routine to modify the radii in picometer of a specific type of atom
-def DEF_atom_blend_radius_pm(atomname, radius_pm, how):
+def radius_pm(atomname, radius_pm, how):
 
     if how == "ALL_IN_LAYER":
 
@@ -278,7 +278,7 @@ def DEF_atom_blend_radius_pm(atomname, radius_pm, how):
 
 
 # Routine to scale the radii of all atoms
-def DEF_atom_blend_radius_all(scale, how):
+def radius_all(scale, how):
 
     if how == "ALL_IN_LAYER":
 
@@ -309,7 +309,7 @@ def DEF_atom_blend_radius_all(scale, how):
                     obj.scale *= scale
 
 
-def DEF_atom_blend_read_elements():
+def read_elements():
 
     ATOM_BLEND_ELEMENTS[:] = []
 
@@ -328,7 +328,7 @@ def DEF_atom_blend_read_elements():
 
 
 # This reads a custom data file.
-def DEF_atom_blend_custom_datafile(path_datafile):
+def custom_datafile(path_datafile):
 
     if path_datafile == "":
         return False