Author: bugman Date: Tue Jan 11 10:57:54 2011 New Revision: 12193 URL: http://svn.gna.org/viewcvs/relax?rev=12193&view=rev Log: The GUI modules now use the status object rather than __main__ for the debug flag and install path. Modified: branches/bieri_gui/gui_bieri/about.py branches/bieri_gui/gui_bieri/analyses/auto_model_free.py branches/bieri_gui/gui_bieri/analyses/auto_noe.py branches/bieri_gui/gui_bieri/analyses/auto_rx_base.py branches/bieri_gui/gui_bieri/controller.py branches/bieri_gui/gui_bieri/paths.py branches/bieri_gui/gui_bieri/relax_gui.py Modified: branches/bieri_gui/gui_bieri/about.py URL: http://svn.gna.org/viewcvs/relax/branches/bieri_gui/gui_bieri/about.py?rev=12193&r1=12192&r2=12193&view=diff ============================================================================== --- branches/bieri_gui/gui_bieri/about.py (original) +++ branches/bieri_gui/gui_bieri/about.py Tue Jan 11 10:57:54 2011 @@ -1,7 +1,7 @@ ############################################################################### # # # Copyright (C) 2009 Michael Bieri # -# Copyright (C) 2010 Edward d'Auvergne # +# Copyright (C) 2010-2011 Edward d'Auvergne # # # # This file is part of the program relax. # # # @@ -22,7 +22,6 @@ ############################################################################### # Python module imports. -import __main__ from copy import deepcopy from numpy import uint8, zeros from os import sep @@ -33,6 +32,7 @@ # relax module imports. from info import Info_box +from status import Status; status = Status() # relax GUI module imports. from paths import IMAGE_PATH @@ -159,7 +159,7 @@ self.set_background() # Debugging lines. - if __main__.debug: + if status.debug: # Cross. self.dc.DrawLine(0, 0, self.virt_x, self.virt_y) self.dc.DrawLine(self.virt_x, 0, 0, self.virt_y) Modified: branches/bieri_gui/gui_bieri/analyses/auto_model_free.py URL: http://svn.gna.org/viewcvs/relax/branches/bieri_gui/gui_bieri/analyses/auto_model_free.py?rev=12193&r1=12192&r2=12193&view=diff ============================================================================== --- branches/bieri_gui/gui_bieri/analyses/auto_model_free.py (original) +++ branches/bieri_gui/gui_bieri/analyses/auto_model_free.py Tue Jan 11 10:57:54 2011 @@ -1,7 +1,7 @@ ############################################################################### # # # Copyright (C) 2009 Michael Bieri # -# Copyright (C) 2010 Edward d'Auvergne # +# Copyright (C) 2010-2011 Edward d'Auvergne # # # # This file is part of the program relax. # # # @@ -25,7 +25,6 @@ """Module for the automatic model-free protocol frame.""" # Python module imports. -import __main__ from os import getcwd, sep from string import replace, split import sys @@ -38,7 +37,7 @@ from data import Relax_data_store; ds = Relax_data_store() from doc_builder import LIST, PARAGRAPH, SECTION, SUBSECTION, TITLE from relax_io import DummyFileObject -from status import Status +from status import Status; status = Status() # relax GUI module imports. @@ -783,7 +782,7 @@ which_model = self.choose_global_model(False) # Display the relax controller. - if not __main__.debug: + if not status.debug: self.gui.controller.Show() # Cancel. @@ -975,7 +974,7 @@ thread_cont = self.gui.calc_threads[-1] # Start the thread. - if __main__.debug: + if status.debug: self.execute_thread(global_models=global_models, automatic=automatic) else: id = thread.start_new_thread(self.execute_thread, (), {'global_models': global_models, 'automatic': automatic}) @@ -1002,7 +1001,7 @@ self.gui.calc_threads[-1].progress = 5.0 # Controller. - if not __main__.debug: + if not status.debug: # Redirect relax output and errors to the controller. redir = Redirect_text(self.gui.controller) sys.stdout = redir Modified: branches/bieri_gui/gui_bieri/analyses/auto_noe.py URL: http://svn.gna.org/viewcvs/relax/branches/bieri_gui/gui_bieri/analyses/auto_noe.py?rev=12193&r1=12192&r2=12193&view=diff ============================================================================== --- branches/bieri_gui/gui_bieri/analyses/auto_noe.py (original) +++ branches/bieri_gui/gui_bieri/analyses/auto_noe.py Tue Jan 11 10:57:54 2011 @@ -1,7 +1,7 @@ ############################################################################### # # # Copyright (C) 2009 Michael Bieri # -# Copyright (C) 2010 Edward d'Auvergne # +# Copyright (C) 2010-2011 Edward d'Auvergne # # # # This file is part of the program relax. # # # @@ -25,7 +25,6 @@ """Module containing the base class for the automatic NOE analysis frames.""" # Python module imports. -import __main__ from os import sep from string import replace import sys @@ -38,7 +37,7 @@ from data import Relax_data_store; ds = Relax_data_store() from relax_errors import RelaxError from relax_io import DummyFileObject -from status import Status +from status import Status; status = Status() # relaxGUI module imports. from gui_bieri.analyses.results_analysis import color_code_noe @@ -551,11 +550,11 @@ self.sync_ds(upload=True) # Display the relax controller (if not debugging). - if not __main__.debug: + if not status.debug: self.gui.controller.Show() # Start the thread (if not debugging). - if __main__.debug: + if status.debug: self.execute_thread() else: id = thread.start_new_thread(self.execute_thread, ()) @@ -568,7 +567,7 @@ """Execute the calculation in a thread.""" # Controller. - if not __main__.debug: + if not status.debug: # Redirect relax output and errors to the controller. redir = Redirect_text(self.gui.controller) sys.stdout = redir @@ -595,7 +594,7 @@ NOE_calc(seq_args=data.seq_args, pipe_name='noe'+'_'+str(time.asctime(time.localtime())), noe_ref=data.ref_file, noe_ref_rmsd=data.ref_rmsd, noe_sat=data.sat_file, noe_sat_rmsd=data.sat_rmsd, unresolved=data.unresolved, pdb_file=data.structure_file, output_file=data.filename, results_dir=data.save_dir, int_method='height', heteronuc=data.heteronuc, proton=data.proton, heteronuc_pdb='@N') # Feedback about success. - if not __main__.debug: + if not status.debug: wx.CallAfter(self.gui.controller.log_panel.AppendText, '\n\n__________________________________________________________\n\nSuccessfully calculated NOE values\n__________________________________________________________') # Add noe grace plot to results list. Modified: branches/bieri_gui/gui_bieri/analyses/auto_rx_base.py URL: http://svn.gna.org/viewcvs/relax/branches/bieri_gui/gui_bieri/analyses/auto_rx_base.py?rev=12193&r1=12192&r2=12193&view=diff ============================================================================== --- branches/bieri_gui/gui_bieri/analyses/auto_rx_base.py (original) +++ branches/bieri_gui/gui_bieri/analyses/auto_rx_base.py Tue Jan 11 10:57:54 2011 @@ -1,7 +1,7 @@ ############################################################################### # # # Copyright (C) 2009 Michael Bieri # -# Copyright (C) 2010 Edward d'Auvergne # +# Copyright (C) 2010-2011 Edward d'Auvergne # # # # This file is part of the program relax. # # # @@ -25,7 +25,6 @@ """Module containing the base class for the automatic R1 and R2 analysis frames.""" # Python module imports. -import __main__ from os import sep from string import replace import sys @@ -37,7 +36,7 @@ from auto_analyses.relax_fit import Relax_fit from data import Relax_data_store; ds = Relax_data_store() from relax_io import DummyFileObject -from status import Status +from status import Status; status = Status() # relaxGUI module imports. from gui_bieri.base_classes import Container @@ -431,11 +430,11 @@ self.sync_ds(upload=True) # Display the relax controller. - if not __main__.debug: + if not status.debug: self.gui.controller.Show() # Start the thread. - if __main__.debug: + if status.debug: self.execute_thread('dummy') else: id = thread.start_new_thread(self.execute_thread, ('dummy',)) @@ -448,7 +447,7 @@ """Execute the calculation in a thread.""" # Controller. - if not __main__.debug: + if not status.debug: # Redirect relax output and errors to the controller. redir = Redirect_text(self.gui.controller) sys.stdout = redir @@ -475,7 +474,7 @@ Relax_fit(file_root=self.filename, pipe_name='rx'+'_'+str(time.asctime(time.localtime())), seq_args=data.seq_args, results_directory=data.save_dir, file_names=data.file_names, relax_times=data.relax_times, int_method=data.int_method, mc_num=data.mc_num, pdb_file=data.structure_file, unresolved=data.unresolved, view_plots = False, heteronuc=data.heteronuc, proton=data.proton, load_spin_ids=data.load_spin_ids, inc=data.inc) # Feedback about success. - if not __main__.debug: + if not status.debug: wx.CallAfter(self.gui.controller.log_panel.AppendText, '\n\n__________________________________________________________\n\nSuccessfully calculated Rx values\n__________________________________________________________') # Add noe grace plot to results list. Modified: branches/bieri_gui/gui_bieri/controller.py URL: http://svn.gna.org/viewcvs/relax/branches/bieri_gui/gui_bieri/controller.py?rev=12193&r1=12192&r2=12193&view=diff ============================================================================== --- branches/bieri_gui/gui_bieri/controller.py (original) +++ branches/bieri_gui/gui_bieri/controller.py Tue Jan 11 10:57:54 2011 @@ -1,7 +1,7 @@ ############################################################################### # # # Copyright (C) 2009 Michael Bieri # -# Copyright (C) 2010 Edward d'Auvergne # +# Copyright (C) 2010-2011 Edward d'Auvergne # # # # This file is part of the program relax. # # # @@ -25,13 +25,12 @@ """Log window of relax GUI controlling all calculations.""" # Python module imports. -import __main__ import sys import time import wx # relax module imports. -from status import Status +from status import Status; status = Status() # relaxGUI module imports. from gui_bieri.paths import IMAGE_PATH @@ -54,7 +53,7 @@ self.border = 5 # IO redirection. - if not __main__.debug: + if not status.debug: redir = Redirect_text(self) sys.stdout = redir sys.stderr = redir Modified: branches/bieri_gui/gui_bieri/paths.py URL: http://svn.gna.org/viewcvs/relax/branches/bieri_gui/gui_bieri/paths.py?rev=12193&r1=12192&r2=12193&view=diff ============================================================================== --- branches/bieri_gui/gui_bieri/paths.py (original) +++ branches/bieri_gui/gui_bieri/paths.py Tue Jan 11 10:57:54 2011 @@ -1,7 +1,7 @@ ############################################################################### # # # Copyright (C) 2009 Michael Bieri # -# Copyright (C) 2010 Edward d'Auvergne # +# Copyright (C) 2010-2011 Edward d'Auvergne # # # # This file is part of the program relax. # # # @@ -28,19 +28,18 @@ """ # Python module imports. -import __main__ from os import sep import sys -# Install path. -if not hasattr(__main__, 'install_path'): - __main__.install_path = sys.path[0] +# relax module imports. +from status import Status; status = Status() + # GUI image and icon paths. -OXY_ICON_PATH = __main__.install_path + sep + 'graphics' + sep + 'oxygen_icons' + sep -IMAGE_PATH = __main__.install_path + sep + 'gui_bieri' + sep + 'images' + sep -ICON_RELAX_PATH = __main__.install_path + sep + 'graphics' + sep + 'relax_icons' + sep -WIZARD_IMAGE_PATH = __main__.install_path + sep + 'graphics' + sep + 'wizards' + sep +OXY_ICON_PATH = status.install_path + sep + 'graphics' + sep + 'oxygen_icons' + sep +IMAGE_PATH = status.install_path + sep + 'gui_bieri' + sep + 'images' + sep +ICON_RELAX_PATH = status.install_path + sep + 'graphics' + sep + 'relax_icons' + sep +WIZARD_IMAGE_PATH = status.install_path + sep + 'graphics' + sep + 'wizards' + sep Modified: branches/bieri_gui/gui_bieri/relax_gui.py URL: http://svn.gna.org/viewcvs/relax/branches/bieri_gui/gui_bieri/relax_gui.py?rev=12193&r1=12192&r2=12193&view=diff ============================================================================== --- branches/bieri_gui/gui_bieri/relax_gui.py (original) +++ branches/bieri_gui/gui_bieri/relax_gui.py Tue Jan 11 10:57:54 2011 @@ -1,7 +1,7 @@ ############################################################################### # # # Copyright (C) 2009 Michael Bieri # -# Copyright (C) 2010 Edward d'Auvergne # +# Copyright (C) 2010-2011 Edward d'Auvergne # # # # This file is part of the program relax. # # # @@ -25,7 +25,6 @@ """Main module for the relax graphical user interface.""" # Python module imports. -import __main__ import os from os import F_OK, access, getcwd, mkdir, sep import platform @@ -41,6 +40,7 @@ from generic_fns import state from generic_fns.reset import reset from relax_io import io_streams_restore +from status import Status; status = Status() from version import version # relaxGUI module imports. @@ -510,9 +510,7 @@ """ # The PDF manual. - if not hasattr(__main__, 'install_path'): - __main__.install_path = sys.path[0] - file = __main__.install_path + sep+"docs"+sep+"relax.pdf" + file = status.install_path + sep+"docs"+sep+"relax.pdf" # Test if it exists. if not access(file, F_OK):