[GRASS-SVN] r42836 - grass/trunk/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Jul 18 14:56:25 EDT 2010


Author: mmetz
Date: 2010-07-18 18:56:25 +0000 (Sun, 18 Jul 2010)
New Revision: 42836

Modified:
   grass/trunk/gui/wxpython/gui_modules/gcpmanager.py
Log:
wxGUI GCP manager: start without POINTS file, fix ColumnSorter on reload

Modified: grass/trunk/gui/wxpython/gui_modules/gcpmanager.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/gcpmanager.py	2010-07-18 17:50:02 UTC (rev 42835)
+++ grass/trunk/gui/wxpython/gui_modules/gcpmanager.py	2010-07-18 18:56:25 UTC (rev 42836)
@@ -781,7 +781,8 @@
             }
 
         # make a backup of the current points file
-        shutil.copy(self.file['points'], self.file['points_bak'])
+        if os.path.exists(self.file['points']):
+            shutil.copy(self.file['points'], self.file['points_bak'])
 
         # polynomial order transformation for georectification
         self.gr_order = 1 
@@ -1241,7 +1242,6 @@
         shutil.copy(self.file['points_bak'], self.file['points'])
 
         # delete all items in mapcoordlist
-        del self.mapcoordlist
         self.mapcoordlist = []
         self.mapcoordlist.append([ 0,        # GCP number
                                    0.0,      # source east
@@ -1252,6 +1252,7 @@
                                    0.0 ] )   # backward error
 
         self.list.LoadData()
+        self.itemDataMap = self.mapcoordlist
     
     def OnFocus(self, event):
         # self.grwiz.SwitchEnv('source')
@@ -1488,9 +1489,11 @@
                 self.SaveGCPs(None)
             elif ret == wx.NO:
                 # restore POINTS file from backup
-                shutil.copy(self.file['points_bak'], self.file['points'])
+                if os.path.exists(self.file['points_bak']):
+                    shutil.copy(self.file['points_bak'], self.file['points'])
 
-            os.unlink(self.file['points_bak'])
+            if os.path.exists(self.file['points_bak']):
+                os.unlink(self.file['points_bak'])
 
             self.grwiz.Cleanup()
 



More information about the grass-commit mailing list