Commit b8bb0758 authored by Vincent Pelletier's avatar Vincent Pelletier

Use dictionary getter (returns None if key is not found).

fix coding style.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@18541 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 740b636f
...@@ -218,11 +218,8 @@ class XMLMatrix(Folder): ...@@ -218,11 +218,8 @@ class XMLMatrix(Folder):
if new_index[base_id].has_key(i): if new_index[base_id].has_key(i):
# Look at each index in a given dimension i # Look at each index in a given dimension i
for my_id in self.index[base_id][i].keys(): 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] 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 # create a movement in dimension i between old_place and new_place
movement[base_id][i][old_place] = new_place movement[base_id][i][old_place] = new_place
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment