mailr27237 - in /branches/frame_order_cleanup: ./ gui/spin_viewer/tree.py


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

Header


Content

Posted by edward on January 20, 2015 - 14:04:
Author: bugman
Date: Tue Jan 20 14:04:06 2015
New Revision: 27237

URL: http://svn.gna.org/viewcvs/relax?rev=27237&view=rev
Log:
Merged revisions 27167 via svnmerge from 
svn+ssh://bugman@xxxxxxxxxxx/svn/relax/trunk

........
  r27167 | bugman | 2015-01-14 17:00:51 +0100 (Wed, 14 Jan 2015) | 10 lines
  
  Fix for bug #23187 (https://gna.org/bugs/?23187).
  
  This is the problem whereby opening the spin viewer window, deleting a 
residue, and then reopening
  the spin viewer crashes relax.
  
  This change completes the spin viewer update_*() functions.  The prune_list 
variable was initialised
  but not used.  Now it is used to store the keys of the items to delete, and 
then the items are
  deleted at the end in a new loop so that the loop over the dictionary keys 
is not corrupted.
........

Modified:
    branches/frame_order_cleanup/   (props changed)
    branches/frame_order_cleanup/gui/spin_viewer/tree.py

Propchange: branches/frame_order_cleanup/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue Jan 20 14:04:06 2015
@@ -1 +1 @@
-/trunk:1-27116,27119-27165
+/trunk:1-27116,27119-27165,27167

Modified: branches/frame_order_cleanup/gui/spin_viewer/tree.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/frame_order_cleanup/gui/spin_viewer/tree.py?rev=27237&r1=27236&r2=27237&view=diff
==============================================================================
--- branches/frame_order_cleanup/gui/spin_viewer/tree.py        (original)
+++ branches/frame_order_cleanup/gui/spin_viewer/tree.py        Tue Jan 20 
14:04:06 2015
@@ -740,10 +740,14 @@
             # Get the python data.
             info = self.tree.GetItemPyData(key)
 
-            # Prune if it has been removed.
+            # Add to the prune list if it has been removed.
             if info['id'] not in mol_ids:
-                self.tree.Delete(key)
-                self.tree_ids.pop(key)
+                prune_list.append(key)
+
+        # Delete the data.
+        for key in prune_list:
+            self.tree.Delete(key)
+            self.tree_ids.pop(key)
 
 
     def prune_res(self, mol_branch_id, mol_id):
@@ -764,10 +768,14 @@
             # Get the residue.
             res = return_residue(info['id'])
 
-            # Prune if it has been removed or renamed/renumbered.
+            # Add to the prune list if it has been removed or 
renamed/renumbered.
             if res == None or res.name != info['res_name'] or res.num != 
info['res_num']:
-                self.tree.Delete(key)
-                self.tree_ids[mol_branch_id].pop(key)
+                prune_list.append(key)
+
+        # Delete the data.
+        for key in prune_list:
+            self.tree.Delete(key)
+            self.tree_ids[mol_branch_id].pop(key)
 
 
     def prune_spin(self, mol_branch_id, res_branch_id, res_id):
@@ -790,10 +798,14 @@
             # Get the spin.
             spin = return_spin(info['id'])
 
-            # Prune if it has been removed or renamed/renumbered.
+            # Add to the prune list if it has been removed or 
renamed/renumbered.
             if spin == None or spin.name != info['spin_name'] or spin.num != 
info['spin_num']:
-                self.tree.Delete(key)
-                self.tree_ids[mol_branch_id][res_branch_id].pop(key)
+                prune_list.append(key)
+
+        # Delete the data.
+        for key in prune_list:
+            self.tree.Delete(key)
+            self.tree_ids[mol_branch_id][res_branch_id].pop(key)
 
 
     def set_bitmap_mol(self, mol_branch_id, select=True):




Related Messages


Powered by MHonArc, Updated Tue Jan 20 14:20:03 2015