mailr16617 - in /branches/uf_redesign: generic_fns/state.py gui/analyses/__init__.py status.py user_functions/state.py


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

Header


Content

Posted by edward on June 04, 2012 - 09:57:
Author: bugman
Date: Mon Jun  4 09:57:29 2012
New Revision: 16617

URL: http://svn.gna.org/viewcvs/relax?rev=16617&view=rev
Log:
The state.load user function will now recreate the GUI tabs.

For this, the new state_load observer object has been created.  The GUI 
analysis load_from_store()
is registered with this object.  And to prevent fatal racing in the GUI, the 
state.load user
function operation is now synchronous.  The state.load and state.save file 
arg defaults are now also
set to 'state.bz2'.


Modified:
    branches/uf_redesign/generic_fns/state.py
    branches/uf_redesign/gui/analyses/__init__.py
    branches/uf_redesign/status.py
    branches/uf_redesign/user_functions/state.py

Modified: branches/uf_redesign/generic_fns/state.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/uf_redesign/generic_fns/state.py?rev=16617&r1=16616&r2=16617&view=diff
==============================================================================
--- branches/uf_redesign/generic_fns/state.py (original)
+++ branches/uf_redesign/generic_fns/state.py Mon Jun  4 09:57:29 2012
@@ -142,6 +142,9 @@
     # Signal a change in the current data pipe.
     status.observers.pipe_alteration.notify()
 
+    # Signal the state loading
+    status.observers.state_load.notify()
+
 
 def save_state(state=None, dir=None, compress_type=1, verbosity=1, 
force=False, pickle=False):
     """Function for saving the program state.

Modified: branches/uf_redesign/gui/analyses/__init__.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/uf_redesign/gui/analyses/__init__.py?rev=16617&r1=16616&r2=16617&view=diff
==============================================================================
--- branches/uf_redesign/gui/analyses/__init__.py (original)
+++ branches/uf_redesign/gui/analyses/__init__.py Mon Jun  4 09:57:29 2012
@@ -92,6 +92,9 @@
         # Register the deletion of all analyses for the reset status 
observer.
         status.observers.reset.register('gui analyses', self.post_reset)
 
+        # Register state loading.
+        status.observers.state_load.register('gui analyses', 
self.load_from_store)
+
 
     def analysis_data_loop(self):
         """Loop over the analyses, yielding the data objects.

Modified: branches/uf_redesign/status.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/uf_redesign/status.py?rev=16617&r1=16616&r2=16617&view=diff
==============================================================================
--- branches/uf_redesign/status.py (original)
+++ branches/uf_redesign/status.py Mon Jun  4 09:57:29 2012
@@ -161,6 +161,9 @@
         # The observer object for the creation of results files.
         self.observers.result_file = Observer('result_file')
 
+        # The observer object for state loading.
+        self.observers.state_load = Observer('state_load')
+
 
     def init_auto_analysis(self, name, type):
         """Initialise a status container for an auto-analysis.

Modified: branches/uf_redesign/user_functions/state.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/uf_redesign/user_functions/state.py?rev=16617&r1=16616&r2=16617&view=diff
==============================================================================
--- branches/uf_redesign/user_functions/state.py (original)
+++ branches/uf_redesign/user_functions/state.py Mon Jun  4 09:57:29 2012
@@ -46,6 +46,7 @@
 uf.title_short = "Saved state loading."
 uf.add_keyarg(
     name = "state",
+    default = "state.bz2",
     py_type = "str_or_inst",
     arg_type = "file sel",
     desc_short = "file name",
@@ -86,6 +87,7 @@
 uf.menu_text = "&load"
 uf.gui_icon = "oxygen.actions.document-open"
 uf.wizard_size = (800, 600)
+uf.gui_sync = True    # Force synchronous operation to avoid races in the 
GUI.
 
 
 # The state.save user function.
@@ -94,6 +96,7 @@
 uf.title_short = "Saving state."
 uf.add_keyarg(
     name = "state",
+    default = "state.bz2",
     py_type = "str_or_inst",
     arg_type = "file sel",
     desc_short = "file name",




Related Messages


Powered by MHonArc, Updated Mon Jun 04 10:40:02 2012