[Erp5-report] r18541 - /erp5/trunk/products/ERP5Type/XMLMatrix.py

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Dec 28 15:11:20 CET 2007


Author: vincent
Date: Fri Dec 28 15:11:20 2007
New Revision: 18541

URL: http://svn.erp5.org?rev=18541&view=rev
Log:
Use dictionary getter (returns None if key is not found).
fix coding style.

Modified:
    erp5/trunk/products/ERP5Type/XMLMatrix.py

Modified: erp5/trunk/products/ERP5Type/XMLMatrix.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/XMLMatrix.py?rev=18541&r1=18540&r2=18541&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/XMLMatrix.py (original)
+++ erp5/trunk/products/ERP5Type/XMLMatrix.py Fri Dec 28 15:11:20 2007
@@ -218,11 +218,8 @@
         if new_index[base_id].has_key(i):
           # Look at each index in a given dimension i
           for my_id in self.index[base_id][i].keys():
-            new_place=None
+            new_place = new_index[base_id][i].get(my_id)
             old_place = self.index[base_id][i][my_id]
-            if my_id in new_index[base_id][i].keys():
-              # if my_id still exists in the new_index
-              new_place = new_index[base_id][i][my_id]
             # create a movement in dimension i between old_place and new_place
             movement[base_id][i][old_place] = new_place
 




More information about the Erp5-report mailing list