Author: bugman Date: Wed Jul 13 19:44:06 2011 New Revision: 13604 URL: http://svn.gna.org/viewcvs/relax?rev=13604&view=rev Log: Renamed all of the observer object methods by removing '_observer'. Modified: branches/gui_testing/generic_fns/pipes.py branches/gui_testing/gui/analyses/__init__.py 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/base.py branches/gui_testing/status.py Modified: branches/gui_testing/generic_fns/pipes.py URL: http://svn.gna.org/viewcvs/relax/branches/gui_testing/generic_fns/pipes.py?rev=13604&r1=13603&r2=13604&view=diff ============================================================================== --- branches/gui_testing/generic_fns/pipes.py (original) +++ branches/gui_testing/generic_fns/pipes.py Wed Jul 13 19:44:06 2011 @@ -142,7 +142,7 @@ __builtin__.cdp = None # Notify observers that the switch has occurred. - status.observers.pipe_switch.notify_observers() + status.observers.pipe_switch.notify() def display(): @@ -262,7 +262,7 @@ __builtin__.cdp = get_pipe() # Notify observers that the switch has occurred. - status.observers.pipe_switch.notify_observers() + status.observers.pipe_switch.notify() def test(pipe_name=None): Modified: branches/gui_testing/gui/analyses/__init__.py URL: http://svn.gna.org/viewcvs/relax/branches/gui_testing/gui/analyses/__init__.py?rev=13604&r1=13603&r2=13604&view=diff ============================================================================== --- branches/gui_testing/gui/analyses/__init__.py (original) +++ branches/gui_testing/gui/analyses/__init__.py Wed Jul 13 19:44:06 2011 @@ -82,7 +82,7 @@ # Register the page switch method for pipe switches. self.name = 'notebook page switcher' - status.observers.pipe_switch.register_observer(self.name, self.pipe_switch) + status.observers.pipe_switch.register(self.name, self.pipe_switch) def analysis_data_loop(self): 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=13604&r1=13603&r2=13604&view=diff ============================================================================== --- branches/gui_testing/gui/analyses/auto_noe.py (original) +++ branches/gui_testing/gui/analyses/auto_noe.py Wed Jul 13 19:44:06 2011 @@ -123,7 +123,7 @@ self.build_main_box(box_centre) # Register the method for updating the spin count for the completion of user functions. - status.observers.uf_gui.register_observer(self.data.pipe_name, self.update_spin_count) + status.observers.uf_gui.register(self.data.pipe_name, self.update_spin_count) def assemble_data(self): @@ -242,7 +242,7 @@ """Unregister the spin count from the user functions.""" # Remove. - status.observers.uf_gui.unregister_observer(self.data.pipe_name) + status.observers.uf_gui.unregister(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=13604&r1=13603&r2=13604&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:44:06 2011 @@ -122,7 +122,7 @@ self.build_main_box(box_centre) # Register the method for updating the spin count for the completion of user functions. - status.observers.uf_gui.register_observer(self.data.pipe_name, self.update_spin_count) + status.observers.uf_gui.register(self.data.pipe_name, self.update_spin_count) def assemble_data(self): @@ -254,7 +254,7 @@ """Unregister the spin count from the user functions.""" # Remove. - status.observers.uf_gui.unregister_observer(self.data.pipe_name) + status.observers.uf_gui.unregister(self.data.pipe_name) def execute(self, event): 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=13604&r1=13603&r2=13604&view=diff ============================================================================== --- branches/gui_testing/gui/spin_viewer/frame.py (original) +++ branches/gui_testing/gui/spin_viewer/frame.py Wed Jul 13 19:44:06 2011 @@ -131,8 +131,8 @@ self.name = 'spin view refresh' # Register a few methods in the observer objects. - status.observers.uf_gui.register_observer(self.name, self.refresh) - status.observers.pipe_switch.register_observer(self.name, self.refresh) + status.observers.uf_gui.register(self.name, self.refresh) + status.observers.pipe_switch.register(self.name, self.refresh) # First update. self.refresh() @@ -166,8 +166,8 @@ """ # Unregister the methods from the observers to avoid unnecessary updating. - status.observers.uf_gui.unregister_observer(self.name) - status.observers.pipe_switch.unregister_observer(self.name) + status.observers.uf_gui.unregister(self.name) + status.observers.pipe_switch.unregister(self.name) # Close the window. self.Hide() 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=13604&r1=13603&r2=13604&view=diff ============================================================================== --- branches/gui_testing/gui/spin_viewer/tree.py (original) +++ branches/gui_testing/gui/spin_viewer/tree.py Wed Jul 13 19:44:06 2011 @@ -206,7 +206,7 @@ self.gui.interpreter.molecule.delete(gui_to_str(self.info['id'])) # Notify all observers that a user function has completed. - status.observers.uf_gui.notify_observers() + status.observers.uf_gui.notify() def delete_residue(self, event): @@ -225,7 +225,7 @@ self.gui.interpreter.residue.delete(gui_to_str(self.info['id'])) # Notify all observers that a user function has completed. - status.observers.uf_gui.notify_observers() + status.observers.uf_gui.notify() def delete_spin(self, event): @@ -244,7 +244,7 @@ self.gui.interpreter.spin.delete(gui_to_str(self.info['id'])) # Notify all observers that a user function has completed. - status.observers.uf_gui.notify_observers() + status.observers.uf_gui.notify() def deselect_molecule(self, event): @@ -263,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. - status.observers.uf_gui.notify_observers() + status.observers.uf_gui.notify() def deselect_residue(self, event): @@ -282,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. - status.observers.uf_gui.notify_observers() + status.observers.uf_gui.notify() def deselect_spin(self, event): @@ -296,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. - status.observers.uf_gui.notify_observers() + status.observers.uf_gui.notify() def get_info(self): @@ -511,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. - status.observers.uf_gui.notify_observers() + status.observers.uf_gui.notify() def select_residue(self, event): @@ -530,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. - status.observers.uf_gui.notify_observers() + status.observers.uf_gui.notify() def select_spin(self, event): @@ -544,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. - status.observers.uf_gui.notify_observers() + status.observers.uf_gui.notify() def set_bitmap_mol(self, mol_branch_id, select=True): 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=13604&r1=13603&r2=13604&view=diff ============================================================================== --- branches/gui_testing/gui/user_functions/base.py (original) +++ branches/gui_testing/gui/user_functions/base.py Wed Jul 13 19:44:06 2011 @@ -252,7 +252,7 @@ """Notify that the user function has completed.""" # Notify. - status.observers.uf_gui.notify_observers() + status.observers.uf_gui.notify() def process_doc(self, doc): Modified: branches/gui_testing/status.py URL: http://svn.gna.org/viewcvs/relax/branches/gui_testing/status.py?rev=13604&r1=13603&r2=13604&view=diff ============================================================================== --- branches/gui_testing/status.py (original) +++ branches/gui_testing/status.py Wed Jul 13 19:44:06 2011 @@ -252,7 +252,7 @@ self._callback = {} - def notify_observers(self): + def notify(self): """Notify all observers of the state change.""" # Loop over the callback methods and execute them. @@ -260,7 +260,7 @@ self._callback[key]() - def register_observer(self, key, method): + def register(self, key, method): """Register a method to be called when the state changes. @param key: The key to identify the observer's method. @@ -277,7 +277,7 @@ self._callback[key] = method - def unregister_observer(self, key): + def unregister(self, key): """Unregister the method corresponding to the key. @param key: The key to identify the observer's method.