[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [3938] contrib/py/scripts/addons/ io_atomblend_utilities: Names of classes were changed, according to the " Style Guide for Python Code"

Clemens Barth barth at root-1.de
Fri Nov 9 00:22:34 CET 2012


Revision: 3938
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=3938
Author:   blendphys
Date:     2012-11-08 23:22:30 +0000 (Thu, 08 Nov 2012)
Log Message:
-----------
Names of classes were changed, according to the "Style Guide for Python Code"
http://www.python.org/dev/peps/pep-0008/

Blendphys

Modified Paths:
--------------
    contrib/py/scripts/addons/io_atomblend_utilities/__init__.py
    contrib/py/scripts/addons/io_atomblend_utilities/io_atomblend_utilities.py

Modified: contrib/py/scripts/addons/io_atomblend_utilities/__init__.py
===================================================================
--- contrib/py/scripts/addons/io_atomblend_utilities/__init__.py	2012-11-08 19:20:25 UTC (rev 3937)
+++ contrib/py/scripts/addons/io_atomblend_utilities/__init__.py	2012-11-08 23:22:30 UTC (rev 3938)
@@ -68,7 +68,7 @@
 
 # This is the panel, which can be used to prepare the scene.
 # It is loaded after the file has been chosen via the menu 'File -> Import'
-class CLASS_atom_blend_prepare_panel(Panel):
+class PreparePanel(Panel):
     bl_label       = "Atomic Blender Utilities"
     bl_space_type  = "VIEW_3D"
     bl_region_type = "TOOL_PROPS"
@@ -122,7 +122,7 @@
 
 
 
-class CLASS_atom_blend_Properties(bpy.types.PropertyGroup):
+class PanelProperties(bpy.types.PropertyGroup):
 
     def Callback_radius_type(self, context):
         scn = bpy.context.scene.atom_blend[0]
@@ -176,7 +176,7 @@
 
 
 # Button loading a custom data file
-class CLASS_atom_blend_datafile_apply(Operator):
+class DatafileApply(Operator):
     bl_idname = "atom_blend.datafile_apply"
     bl_label = "Apply"
     bl_description = "Use color and radii values stored in the custom file"
@@ -208,7 +208,7 @@
 
 
 # Button for separating a single atom from a structure
-class CLASS_atom_blend_separate_atom(Operator):
+class SeparateAtom(Operator):
     bl_idname = "atom_blend.separate_atom"
     bl_label = "Separate atoms"
     bl_description = ("Separate atoms you have selected. "
@@ -297,7 +297,7 @@
 
 
 # Button for measuring the distance of the active objects
-class CLASS_atom_blend_distance_button(Operator):
+class DistanceButton(Operator):
     bl_idname = "atom_blend.button_distance"
     bl_label = "Measure ..."
     bl_description = "Measure the distance between two objects"
@@ -320,7 +320,7 @@
 
 
 # Button for increasing the radii of all atoms
-class CLASS_atom_blend_radius_all_bigger_button(Operator):
+class RadiusAllBiggerButton(Operator):
     bl_idname = "atom_blend.radius_all_bigger"
     bl_label = "Bigger ..."
     bl_description = "Increase the radii of the atoms"
@@ -335,7 +335,7 @@
 
 
 # Button for decreasing the radii of all atoms
-class CLASS_atom_blend_radius_all_smaller_button(Operator):
+class RadiusAllSmallerButton(Operator):
     bl_idname = "atom_blend.radius_all_smaller"
     bl_label = "Smaller ..."
     bl_description = "Decrease the radii of the atoms"
@@ -355,7 +355,7 @@
     io_atomblend_utilities.DEF_atom_blend_read_elements()  
     bpy.utils.register_module(__name__)
     bpy.types.Scene.atom_blend = bpy.props.CollectionProperty(type=
-                                                   CLASS_atom_blend_Properties)
+                                                   PanelProperties)
     bpy.context.scene.atom_blend.add()
 
 

Modified: contrib/py/scripts/addons/io_atomblend_utilities/io_atomblend_utilities.py
===================================================================
--- contrib/py/scripts/addons/io_atomblend_utilities/io_atomblend_utilities.py	2012-11-08 19:20:25 UTC (rev 3937)
+++ contrib/py/scripts/addons/io_atomblend_utilities/io_atomblend_utilities.py	2012-11-08 23:22:30 UTC (rev 3938)
@@ -156,14 +156,14 @@
 # This list here contains all data of the elements and will be used during
 # runtime. It is a list of classes.
 # During executing Atomic Blender, the list will be initialized with the fixed
-# data from above via the class structure below (CLASS_atom_blend_Elements). We
+# data from above via the class structure below (ElementProp). We
 # have then one fixed list (above), which will never be changed, and a list of
 # classes with same data. The latter can be modified via loading a separate
 # custom data file for instance.
 ATOM_BLEND_ELEMENTS = []
 
 # This is the class, which stores the properties for one element.
-class CLASS_atom_blend_Elements(object):
+class ElementProp(object):
     __slots__ = ('number', 'name', 'short_name', 'color', 'radii', 'radii_ionic')
     def __init__(self, number, name, short_name, color, radii, radii_ionic):
         self.number = number
@@ -173,23 +173,11 @@
         self.radii = radii
         self.radii_ionic = radii_ionic
 
-# This is the class, which stores the properties of one atom.
-class CLASS_atom_blend_atom(object):  
-    __slots__ = ('element', 'name', 'location', 'radius', 'color', 'material')
-    def __init__(self, element, name, location, radius, color, material):
-        self.element = element
-        self.name = name
-        self.location = location
-        self.radius = radius
-        self.color = color
-        self.material = material
-        
 
 # -----------------------------------------------------------------------------
 #                                                          Some small routines
 
 
-
 # This function measures the distance between two objects (atoms),
 # which are active.
 def DEF_atom_blend_distance():
@@ -333,7 +321,7 @@
         # empty list.
         radii_ionic = []
 
-        li = CLASS_atom_blend_Elements(item[0],item[1],item[2],item[3],
+        li = ElementProp(item[0],item[1],item[2],item[3],
                                      radii,radii_ionic)
         ATOM_BLEND_ELEMENTS.append(li)
 
@@ -389,7 +377,7 @@
             radii = [radius_used,radius_atomic,radius_vdW]
             radii_ionic = []
 
-            element = CLASS_atom_blend_Elements(number,name,short_name,color,
+            element = ElementProp(number,name,short_name,color,
                                               radii, radii_ionic)
 
             ATOM_BLEND_ELEMENTS.append(element)



More information about the Bf-extensions-cvs mailing list