[hdf-compass] 113/295: Fix for the file history bug

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Sun May 8 10:35:33 UTC 2016


This is an automated email from the git hooks/post-receive script.

ghisvail-guest pushed a commit to branch debian/master
in repository hdf-compass.

commit 64115d8ca71b553652bd4f683834d0177763defb
Author: giumas <giumas at yahoo.it>
Date:   Wed Oct 7 08:15:09 2015 -0400

    Fix for the file history bug
---
 hdf_compass/compass_viewer/frame.py | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/hdf_compass/compass_viewer/frame.py b/hdf_compass/compass_viewer/frame.py
index 032d495..f65523b 100644
--- a/hdf_compass/compass_viewer/frame.py
+++ b/hdf_compass/compass_viewer/frame.py
@@ -175,15 +175,14 @@ class BaseFrame(wx.Frame):
         self.filehistory.AddFileToHistory(path)
         self.filehistory.Save(self.config)
         self.config.Flush()
-            
-        url = 'file://'+path
 
         if not open_store(url):
-            self.filehistory.RemoveFileToHistory(path)
+            fileNum = evt.GetId() - wx.ID_FILE1
+            self.filehistory.RemoveFileFromHistory(fileNum)
             self.filehistory.Save(self.config)
             self.config.Flush()
             dlg = wx.MessageDialog(self, 'The following file could not be opened:\n\n%s' % path,
-                               'No handler for file', wx.OK | wx.ICON_INFORMATION)
+                                   'No handler for file', wx.OK | wx.ICON_INFORMATION)
             dlg.ShowModal()
             dlg.Destroy()
     
@@ -197,9 +196,12 @@ class BaseFrame(wx.Frame):
         
         # open the file
         from . import open_store
-        url = 'file://'+path
+        if sys.platform == 'win32':
+            url = 'file:///' + path
+        else:
+            url = 'file://' + path
         if not open_store(url):
-            self.filehistory.RemoveFileToHistory(path)
+            self.filehistory.RemoveFileFromHistory(fileNum)
             self.filehistory.Save(self.config)
             self.config.Flush()
             dlg = wx.MessageDialog(self, 'The following file could not be opened:\n\n%s' % path,

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/hdf-compass.git



More information about the debian-science-commits mailing list