Package gui :: Package user_functions :: Module sys_info
[hide private]
[frames] | no frames]

Source Code for Module gui.user_functions.sys_info

  1  ############################################################################### 
  2  #                                                                             # 
  3  # Copyright (C) 2011 Edward d'Auvergne                                        # 
  4  #                                                                             # 
  5  # This file is part of the program relax.                                     # 
  6  #                                                                             # 
  7  # relax is free software; you can redistribute it and/or modify               # 
  8  # it under the terms of the GNU General Public License as published by        # 
  9  # the Free Software Foundation; either version 2 of the License, or           # 
 10  # (at your option) any later version.                                         # 
 11  #                                                                             # 
 12  # relax is distributed in the hope that it will be useful,                    # 
 13  # but WITHOUT ANY WARRANTY; without even the implied warranty of              # 
 14  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               # 
 15  # GNU General Public License for more details.                                # 
 16  #                                                                             # 
 17  # You should have received a copy of the GNU General Public License           # 
 18  # along with relax; if not, write to the Free Software                        # 
 19  # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA   # 
 20  #                                                                             # 
 21  ############################################################################### 
 22   
 23  # Module docstring. 
 24  """The structure user function GUI elements.""" 
 25   
 26  # Python module imports. 
 27  from os import sep 
 28  from string import split 
 29  from time import sleep 
 30  import wx 
 31   
 32  # relax module imports. 
 33  from generic_fns.pipes import cdp_name, pipe_names 
 34   
 35  # GUI module imports. 
 36  from base import UF_base, UF_page 
 37  from gui.misc import float_to_gui, gui_to_bool, gui_to_float, gui_to_int, gui_to_int_or_list, gui_to_str, gui_to_str_or_list, str_to_gui 
 38  from gui.paths import WIZARD_IMAGE_PATH 
 39   
 40   
 41  # The container class. 
42 -class Sys_info(UF_base):
43 """The container class for holding all GUI elements.""" 44
45 - def sys_info(self):
46 """The sys_info user function.""" 47 48 # Create and execute the wizard. 49 wizard = self.create_wizard(size_x=600, size_y=400, name='sys_info', uf_page=Sys_info_page, apply_button=False) 50 wizard.run()
51 52 53
54 -class Sys_info_page(UF_page):
55 """The sys_info() user function page.""" 56 57 # Some class variables. 58 uf_path = ['sys_info'] 59
60 - def __init__(self, parent, sync=False):
61 """Set up the window. 62 63 @param parent: The parent class containing the GUI. 64 @type parent: class instance 65 @keyword sync: A flag which is ignored. 66 @type sync: bool 67 """ 68 69 # Execute the base class method. 70 super(Sys_info_page, self).__init__(parent, sync=True)
71 72
73 - def add_contents(self, sizer):
74 """Add the structure specific GUI elements. 75 76 @param sizer: A sizer object. 77 @type sizer: wx.Sizer instance 78 """
79 80
81 - def on_execute(self):
82 """Execute the user function.""" 83 84 # Get the App. 85 app = wx.GetApp() 86 87 # First show the controller. 88 app.gui.show_controller(None) 89 90 # Go to the last line. 91 app.gui.controller.log_panel.on_goto_end(None) 92 93 # Wait a little while. 94 sleep(0.5) 95 96 # Finally, execute the user function. 97 self.execute('sys_info') 98 99 # Bring the controller to the front. 100 wx.CallAfter(app.gui.controller.Raise)
101