mailr17617 - in /trunk/data: align_tensor.py data_classes.py diff_tensor.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on September 28, 2012 - 19:04:
Author: bugman
Date: Fri Sep 28 19:04:46 2012
New Revision: 17617

URL: http://svn.gna.org/viewcvs/relax?rev=17617&view=rev
Log:
Python 3 preparations - eliminated the use of the types.ListType object.


Modified:
    trunk/data/align_tensor.py
    trunk/data/data_classes.py
    trunk/data/diff_tensor.py

Modified: trunk/data/align_tensor.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/data/align_tensor.py?rev=17617&r1=17616&r2=17617&view=diff
==============================================================================
--- trunk/data/align_tensor.py (original)
+++ trunk/data/align_tensor.py Fri Sep 28 19:04:46 2012
@@ -24,7 +24,6 @@
 from math import cos, sin
 from numpy import array, dot, eye, float64, identity, transpose, zeros
 from numpy.linalg import det, eig, eigvals
-from types import ListType
 
 # relax module imports.
 from data_classes import Element
@@ -924,7 +923,7 @@
 # Alignment tensor specific data.
 #################################
 
-class AlignTensorList(ListType):
+class AlignTensorList(list):
     """List type data container for holding all the alignment tensors.
 
     The elements of the list should be AlignTensorData instances.
@@ -1292,7 +1291,7 @@
 
 
 
-class AlignTensorSimList(ListType):
+class AlignTensorSimList(list):
     """Empty data container for Monte Carlo simulation alignment tensor 
data."""
 
     def __init__(self, param_name, align_element):
@@ -1310,7 +1309,7 @@
         """Set the value."""
 
         # Set the value.
-        ListType.__setitem__(self, index, value)
+        list.__setitem__(self, index, value)
 
         # Then update the other lists.
         self.align_element._AlignTensorData__update_sim_set(self.param_name, 
index)
@@ -1337,4 +1336,4 @@
         """Set the value for an untouchable MC data structure."""
 
         # Set the value.
-        ListType.__setitem__(self, index, value)
+        list.__setitem__(self, index, value)

Modified: trunk/data/data_classes.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/data/data_classes.py?rev=17617&r1=17616&r2=17617&view=diff
==============================================================================
--- trunk/data/data_classes.py (original)
+++ trunk/data/data_classes.py Fri Sep 28 19:04:46 2012
@@ -25,7 +25,6 @@
 # Python module imports.
 from re import search
 from numpy import ndarray
-from types import ListType
 
 # relax module imports.
 from relax_xml import fill_object_contents, xml_to_object
@@ -166,7 +165,7 @@
 
 
 
-class RelaxListType(ListType):
+class RelaxListType(list):
     """An empty list type container."""
 
     def __init__(self):
@@ -226,7 +225,7 @@
         list_element.setAttribute('desc', self.list_desc)
 
         # Blacklisted objects.
-        blacklist = ['list_name', 'list_desc', 'element_name', 
'element_desc', 'blacklist'] + list(self.__dict__.keys() + 
RelaxListType.__dict__.keys() + self.__class__.__dict__.keys() + 
list.__dict__.keys() + ListType.__dict__.keys())
+        blacklist = ['list_name', 'list_desc', 'element_name', 
'element_desc', 'blacklist'] + list(self.__dict__.keys() + 
RelaxListType.__dict__.keys() + self.__class__.__dict__.keys() + 
list.__dict__.keys() + list.__dict__.keys())
 
         # Add all simple python objects within the list to the list element.
         fill_object_contents(doc, list_element, object=self, 
blacklist=blacklist)

Modified: trunk/data/diff_tensor.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/data/diff_tensor.py?rev=17617&r1=17616&r2=17617&view=diff
==============================================================================
--- trunk/data/diff_tensor.py (original)
+++ trunk/data/diff_tensor.py Fri Sep 28 19:04:46 2012
@@ -24,7 +24,6 @@
 from re import search
 from math import cos, sin
 from numpy import array, float64, dot, identity, transpose, zeros
-from types import ListType
 
 # relax module imports.
 from data_classes import Element
@@ -977,7 +976,7 @@
 
 
 
-class DiffTensorSimList(ListType):
+class DiffTensorSimList(list):
     """Empty data container for Monte Carlo simulation diffusion tensor 
data."""
 
     def __deepcopy__(self, memo):
@@ -993,7 +992,7 @@
                 continue
 
             # Skip the class methods.
-            if name in list(self.__class__.__dict__.keys()) or name in 
dir(ListType):
+            if name in list(self.__class__.__dict__.keys()) or name in 
dir(list):
                 continue
 
             # Skip the diff_element object.
@@ -1039,7 +1038,7 @@
         """Set the value."""
 
         # Set the value.
-        ListType.__setitem__(self, index, value)
+        list.__setitem__(self, index, value)
 
         # Then update the other lists.
         self.diff_element._DiffTensorData__update_sim_set(self.param_name, 
index)
@@ -1066,4 +1065,4 @@
         """Set the value for an untouchable MC data structure."""
 
         # Set the value.
-        ListType.__setitem__(self, index, value)
+        list.__setitem__(self, index, value)




Related Messages


Powered by MHonArc, Updated Fri Sep 28 19:20:02 2012