[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [2711] trunk/py/scripts/addons/ io_mesh_pdb/import_pdb.py:
Clemens Barth
barth at root-1.de
Fri Dec 2 21:20:48 CET 2011
Revision: 2711
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=2711
Author: blendphys
Date: 2011-12-02 20:20:43 +0000 (Fri, 02 Dec 2011)
Log Message:
-----------
Dear all.
Some large data classes (elements, atoms and sticks) use
__slots__
now.
Cheers,
Blendphys.
Modified Paths:
--------------
trunk/py/scripts/addons/io_mesh_pdb/import_pdb.py
Modified: trunk/py/scripts/addons/io_mesh_pdb/import_pdb.py
===================================================================
--- trunk/py/scripts/addons/io_mesh_pdb/import_pdb.py 2011-12-01 23:22:11 UTC (rev 2710)
+++ trunk/py/scripts/addons/io_mesh_pdb/import_pdb.py 2011-12-02 20:20:43 UTC (rev 2711)
@@ -184,8 +184,9 @@
ATOM_PDB_ELEMENTS = []
# This is the class, which stores the properties for one element.
-class CLASS_atom_pdb_Elements: # TODO, use __slots__
- def __init__(self, number, name,short_name, color, radii, radii_ionic):
+class CLASS_atom_pdb_Elements(object):
+ __slots__ = ('number', 'name', 'short_name', 'color', 'radii', 'radii_ionic')
+ def __init__(self, number, name, short_name, color, radii, radii_ionic):
self.number = number
self.name = name
self.short_name = short_name
@@ -194,7 +195,8 @@
self.radii_ionic = radii_ionic
# This is the class, which stores the properties of one atom.
-class CLASS_atom_pdb_atom: # TODO, use __slots__
+class CLASS_atom_pdb_atom(object):
+ __slots__ = ('element', 'name', 'location', 'radius', 'color', 'material')
def __init__(self, element, name, location, radius, color, material):
self.element = element
self.name = name
@@ -204,7 +206,8 @@
self.material = material
# This is the class, which stores the two atoms of one stick.
-class CLASS_atom_pdb_stick: # TODO, use __slots__
+class CLASS_atom_pdb_stick(object):
+ __slots__ = ('atom1', 'atom2')
def __init__(self, atom1, atom2):
self.atom1 = atom1
self.atom2 = atom2
More information about the Bf-extensions-cvs
mailing list