mailr13236 - /branches/gui_testing/gui/analyses/auto_noe.py


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

Header


Content

Posted by edward on June 27, 2011 - 15:16:
Author: bugman
Date: Mon Jun 27 15:16:51 2011
New Revision: 13236

URL: http://svn.gna.org/viewcvs/relax?rev=13236&view=rev
Log:
Fix for the NOE ref and sat GUI elements - the directory for the file 
selection dialog is now correct.

Previously the directory was the full path of the file, so it failed.


Modified:
    branches/gui_testing/gui/analyses/auto_noe.py

Modified: branches/gui_testing/gui/analyses/auto_noe.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/gui_testing/gui/analyses/auto_noe.py?rev=13236&r1=13235&r2=13236&view=diff
==============================================================================
--- branches/gui_testing/gui/analyses/auto_noe.py (original)
+++ branches/gui_testing/gui/analyses/auto_noe.py Mon Jun 27 15:16:51 2011
@@ -26,6 +26,7 @@
 
 # Python module imports.
 from os import sep
+from os.path import dirname
 from string import replace
 import sys
 import thread
@@ -46,7 +47,7 @@
 from gui.derived_wx_classes import StructureTextCtrl
 from gui.filedialog import opendir, openfile
 from gui.message import error_message, missing_data
-from gui.misc import add_border, str_to_gui
+from gui.misc import add_border, gui_to_str, str_to_gui
 from gui import paths
 from gui.settings import load_sequence
 
@@ -378,10 +379,15 @@
         """
 
         # Store the original directory.
-        backup = self.field_ref_noe.GetValue()
+        backup = gui_to_str(self.field_ref_noe.GetValue())
+
+        # The directory.
+        directory = None
+        if backup != None:
+            directory = dirname(backup)
 
         # Select the file.
-        self.data.ref_file = openfile('Select reference NOE peak list', 
directory=self.field_ref_noe.GetValue(), default = 'all files (*.*)|*')
+        self.data.ref_file = openfile('Select reference NOE peak list', 
directory=directory, default = 'all files (*.*)|*')
 
         # Restore the backup file if no file was chosen.
         if not self.data.ref_file:
@@ -426,10 +432,15 @@
         """
 
         # Store the original directory.
-        backup = self.field_sat_noe.GetValue()
+        backup = gui_to_str(self.field_sat_noe.GetValue())
+
+        # The directory.
+        directory = None
+        if backup != None:
+            directory = dirname(backup)
 
         # Select the file.
-        self.data.sat_file = openfile('Select saturated NOE peak list', 
directory=self.field_sat_noe.GetValue(), default = 'all files (*.*)|*')
+        self.data.sat_file = openfile('Select saturated NOE peak list', 
directory=directory, default = 'all files (*.*)|*')
 
         # Restore the backup file if no file was chosen.
         if not self.data.sat_file:




Related Messages


Powered by MHonArc, Updated Mon Jun 27 15:20:02 2011