mailr13603 - in /branches/gui_testing: ./ gui/analyses/ gui/spin_viewer/ gui/user_functions/


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

Header


Content

Posted by edward on July 13, 2011 - 19:40:
Author: bugman
Date: Wed Jul 13 19:40:26 2011
New Revision: 13603

URL: http://svn.gna.org/viewcvs/relax?rev=13603&view=rev
Log:
The GUI user function observer object is now located in 
status.observers.uf_gui.


Modified:
    branches/gui_testing/gui/analyses/auto_noe.py
    branches/gui_testing/gui/analyses/auto_rx_base.py
    branches/gui_testing/gui/spin_viewer/frame.py
    branches/gui_testing/gui/spin_viewer/tree.py
    branches/gui_testing/gui/user_functions/__init__.py
    branches/gui_testing/gui/user_functions/base.py
    branches/gui_testing/status.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=13603&r1=13602&r2=13603&view=diff
==============================================================================
--- branches/gui_testing/gui/analyses/auto_noe.py (original)
+++ branches/gui_testing/gui/analyses/auto_noe.py Wed Jul 13 19:40:26 2011
@@ -89,8 +89,7 @@
         # New data container.
         if data_index == None:
             # First create the data pipe (if this fails, then no data is set 
up).
-            status = protected_exec(self.gui.interpreter.pipe.create, 
pipe_name, 'noe')
-            if not status:
+            if not protected_exec(self.gui.interpreter.pipe.create, 
pipe_name, 'noe'):
                 self.init_flag = False
                 return
 
@@ -124,7 +123,7 @@
         self.build_main_box(box_centre)
 
         # Register the method for updating the spin count for the completion 
of user functions.
-        self.gui.user_functions.register_observer(self.data.pipe_name, 
self.update_spin_count)
+        status.observers.uf_gui.register_observer(self.data.pipe_name, 
self.update_spin_count)
 
 
     def assemble_data(self):
@@ -243,7 +242,7 @@
         """Unregister the spin count from the user functions."""
 
         # Remove.
-        self.gui.user_functions.unregister_observer(self.data.pipe_name)
+        status.observers.uf_gui.unregister_observer(self.data.pipe_name)
 
 
     def execute(self, event):

Modified: branches/gui_testing/gui/analyses/auto_rx_base.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/gui_testing/gui/analyses/auto_rx_base.py?rev=13603&r1=13602&r2=13603&view=diff
==============================================================================
--- branches/gui_testing/gui/analyses/auto_rx_base.py (original)
+++ branches/gui_testing/gui/analyses/auto_rx_base.py Wed Jul 13 19:40:26 2011
@@ -84,8 +84,7 @@
         # New data container.
         if data_index == None:
             # First create the data pipe (if this fails, then no data is set 
up).
-            status = protected_exec(self.gui.interpreter.pipe.create, 
pipe_name, 'relax_fit')
-            if not status:
+            if not protected_exec(self.gui.interpreter.pipe.create, 
pipe_name, 'relax_fit'):
                 self.init_flag = False
                 return
 
@@ -123,7 +122,7 @@
         self.build_main_box(box_centre)
 
         # Register the method for updating the spin count for the completion 
of user functions.
-        self.gui.user_functions.register_observer(self.data.pipe_name, 
self.update_spin_count)
+        status.observers.uf_gui.register_observer(self.data.pipe_name, 
self.update_spin_count)
 
 
     def assemble_data(self):
@@ -255,7 +254,7 @@
         """Unregister the spin count from the user functions."""
 
         # Remove.
-        self.gui.user_functions.unregister_observer(self.data.pipe_name)
+        status.observers.uf_gui.unregister_observer(self.data.pipe_name)
 
 
     def execute(self, event):
@@ -266,7 +265,6 @@
         """
 
         # relax execution lock.
-        status = Status()
         if status.exec_lock.locked():
             error_message("relax is currently executing.", "relax execution 
lock")
             event.Skip()

Modified: branches/gui_testing/gui/spin_viewer/frame.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/gui_testing/gui/spin_viewer/frame.py?rev=13603&r1=13602&r2=13603&view=diff
==============================================================================
--- branches/gui_testing/gui/spin_viewer/frame.py (original)
+++ branches/gui_testing/gui/spin_viewer/frame.py Wed Jul 13 19:40:26 2011
@@ -131,7 +131,7 @@
         self.name = 'spin view refresh'
 
         # Register a few methods in the observer objects.
-        self.gui.user_functions.register_observer(self.name, self.refresh)
+        status.observers.uf_gui.register_observer(self.name, self.refresh)
         status.observers.pipe_switch.register_observer(self.name, 
self.refresh)
 
         # First update.
@@ -166,7 +166,7 @@
         """
 
         # Unregister the methods from the observers to avoid unnecessary 
updating.
-        self.gui.user_functions.unregister_observer(self.name)
+        status.observers.uf_gui.unregister_observer(self.name)
         status.observers.pipe_switch.unregister_observer(self.name)
 
         # Close the window.

Modified: branches/gui_testing/gui/spin_viewer/tree.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/gui_testing/gui/spin_viewer/tree.py?rev=13603&r1=13602&r2=13603&view=diff
==============================================================================
--- branches/gui_testing/gui/spin_viewer/tree.py (original)
+++ branches/gui_testing/gui/spin_viewer/tree.py Wed Jul 13 19:40:26 2011
@@ -31,6 +31,7 @@
 from generic_fns.selection import is_mol_selected, is_res_selected, 
is_spin_selected
 from generic_fns.mol_res_spin import get_molecule_ids, get_residue_ids, 
get_spin_ids, molecule_loop, residue_loop, spin_loop
 from generic_fns.pipes import get_pipe
+from status import Status; status = Status()
 
 # GUI module imports.
 from gui import paths
@@ -205,7 +206,7 @@
         self.gui.interpreter.molecule.delete(gui_to_str(self.info['id']))
 
         # Notify all observers that a user function has completed.
-        self.gui.user_functions.notify_observers()
+        status.observers.uf_gui.notify_observers()
 
 
     def delete_residue(self, event):
@@ -224,7 +225,7 @@
         self.gui.interpreter.residue.delete(gui_to_str(self.info['id']))
 
         # Notify all observers that a user function has completed.
-        self.gui.user_functions.notify_observers()
+        status.observers.uf_gui.notify_observers()
 
 
     def delete_spin(self, event):
@@ -243,7 +244,7 @@
         self.gui.interpreter.spin.delete(gui_to_str(self.info['id']))
 
         # Notify all observers that a user function has completed.
-        self.gui.user_functions.notify_observers()
+        status.observers.uf_gui.notify_observers()
 
 
     def deselect_molecule(self, event):
@@ -262,7 +263,7 @@
         
self.gui.interpreter.deselect.spin(spin_id=gui_to_str(self.info['id']), 
change_all=False)
 
         # Notify all observers that a user function has completed.
-        self.gui.user_functions.notify_observers()
+        status.observers.uf_gui.notify_observers()
 
 
     def deselect_residue(self, event):
@@ -281,7 +282,7 @@
         
self.gui.interpreter.deselect.spin(spin_id=gui_to_str(self.info['id']), 
change_all=False)
 
         # Notify all observers that a user function has completed.
-        self.gui.user_functions.notify_observers()
+        status.observers.uf_gui.notify_observers()
 
 
     def deselect_spin(self, event):
@@ -295,7 +296,7 @@
         
self.gui.interpreter.deselect.spin(spin_id=gui_to_str(self.info['id']), 
change_all=False)
 
         # Notify all observers that a user function has completed.
-        self.gui.user_functions.notify_observers()
+        status.observers.uf_gui.notify_observers()
 
 
     def get_info(self):
@@ -510,7 +511,7 @@
         
self.gui.interpreter.select.spin(spin_id=gui_to_str(self.info['id']), 
change_all=False)
 
         # Notify all observers that a user function has completed.
-        self.gui.user_functions.notify_observers()
+        status.observers.uf_gui.notify_observers()
 
 
     def select_residue(self, event):
@@ -529,7 +530,7 @@
         
self.gui.interpreter.select.spin(spin_id=gui_to_str(self.info['id']), 
change_all=False)
 
         # Notify all observers that a user function has completed.
-        self.gui.user_functions.notify_observers()
+        status.observers.uf_gui.notify_observers()
 
 
     def select_spin(self, event):
@@ -543,7 +544,7 @@
         
self.gui.interpreter.select.spin(spin_id=gui_to_str(self.info['id']), 
change_all=False)
 
         # Notify all observers that a user function has completed.
-        self.gui.user_functions.notify_observers()
+        status.observers.uf_gui.notify_observers()
 
 
     def set_bitmap_mol(self, mol_branch_id, select=True):

Modified: branches/gui_testing/gui/user_functions/__init__.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/gui_testing/gui/user_functions/__init__.py?rev=13603&r1=13602&r2=13603&view=diff
==============================================================================
--- branches/gui_testing/gui/user_functions/__init__.py (original)
+++ branches/gui_testing/gui/user_functions/__init__.py Wed Jul 13 19:40:26 
2011
@@ -24,7 +24,6 @@
 """User function GUI elements."""
 
 # relax module imports.
-from status import Observer
 from relax_errors import RelaxError
 
 # GUI module imports.
@@ -58,7 +57,7 @@
            'value']
 
 
-class User_functions(Observer):
+class User_functions:
     """Container for all the user function GUI elements.
 
     This uses the observer design pattern to allow for GUI updates upon 
completion of a user function.
@@ -69,9 +68,6 @@
 
         # Store the args.
         self.gui = gui
-
-        # Execute the observer base class module __init__() method.
-        super(User_functions, self).__init__()
 
         # The user functions.
         self.deselect = Deselect(self.gui)

Modified: branches/gui_testing/gui/user_functions/base.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/gui_testing/gui/user_functions/base.py?rev=13603&r1=13602&r2=13603&view=diff
==============================================================================
--- branches/gui_testing/gui/user_functions/base.py (original)
+++ branches/gui_testing/gui/user_functions/base.py Wed Jul 13 19:40:26 2011
@@ -252,7 +252,7 @@
         """Notify that the user function has completed."""
 
         # Notify.
-        self.gui.user_functions.notify_observers()
+        status.observers.uf_gui.notify_observers()
 
 
     def process_doc(self, doc):

Modified: branches/gui_testing/status.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/gui_testing/status.py?rev=13603&r1=13602&r2=13603&view=diff
==============================================================================
--- branches/gui_testing/status.py (original)
+++ branches/gui_testing/status.py Wed Jul 13 19:40:26 2011
@@ -95,6 +95,9 @@
         # The observer object for pipe switches.
         self.observers.pipe_switch = Observer()
 
+        # The observer object for GUI user function completion.
+        self.observers.uf_gui = Observer()
+
 
 
 class Status_container:




Related Messages


Powered by MHonArc, Updated Wed Jul 13 20:00:01 2011