diff getan.py @ 33:f96a18c10836

Made getan python-2.4 compatible.
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Tue, 31 Aug 2010 19:37:37 +0200
parents fa5b3b1db867
children f44f808e7d47
line wrap: on
line diff
--- a/getan.py	Tue Aug 31 19:27:36 2010 +0200
+++ b/getan.py	Tue Aug 31 19:37:37 2010 +0200
@@ -58,7 +58,7 @@
         old_project = None
         entries = []
         try:
-            while True:
+            while self.entries_view.selection:
                 node = self.entries_view.selection.pop()
                 if node.selected: node.select()
                 entries.append(node.item)
@@ -69,8 +69,6 @@
 
                 if not old_project:
                     old_project = self.project_by_id(node.item.project_id)
-        except IndexError, err:
-            pass
         finally:
             self.backend.move_entries(entries, project.id)
             if not old_project: return
@@ -84,7 +82,7 @@
         proj    = None
         entries = []
         try:
-            while True:
+            while self.entries_view.selection:
                 node = self.entries_view.selection.pop()
                 if node.selected: node.select()
                 entries.append(node.item)
@@ -95,8 +93,6 @@
 
                 if proj is None:
                     proj = self.project_by_id(node.item.project_id)
-        except IndexError, err:
-            pass
         finally:
             self.backend.delete_entries(entries)
             proj.entries = self.backend.load_entries(proj.id)
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)