mailr9886 - in /branches/bieri_gui: dep_check.py gui_bieri/__init__.py gui_bieri/relax_gui.py relax


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

Header


Content

Posted by edward on November 19, 2009 - 11:35:
Author: bugman
Date: Thu Nov 19 11:35:08 2009
New Revision: 9886

URL: http://svn.gna.org/viewcvs/relax?rev=9886&view=rev
Log:
Added support for launching the Bieri GUI.

The presence of the wx Python module is now being tested, and an appropriate 
error message printed when missing.


Modified:
    branches/bieri_gui/dep_check.py
    branches/bieri_gui/gui_bieri/__init__.py
    branches/bieri_gui/gui_bieri/relax_gui.py
    branches/bieri_gui/relax

Modified: branches/bieri_gui/dep_check.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/bieri_gui/dep_check.py?rev=9886&r1=9885&r2=9886&view=diff
==============================================================================
--- branches/bieri_gui/dep_check.py (original)
+++ branches/bieri_gui/dep_check.py Thu Nov 19 11:35:08 2009
@@ -59,9 +59,16 @@
     sys.stderr.write("The dependency 'minfx' has not been installed (see 
https://gna.org/projects/minfx/).\n")
     sys.exit()
 
-
 # Optional packages.
 ####################
+
+# wx package for the Bieri gui.
+try:
+    import wx
+    del wx
+    wx_module = True
+except ImportError:
+    wx_module = False
 
 # Readline module.
 try:

Modified: branches/bieri_gui/gui_bieri/__init__.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/bieri_gui/gui_bieri/__init__.py?rev=9886&r1=9885&r2=9886&view=diff
==============================================================================
--- branches/bieri_gui/gui_bieri/__init__.py (original)
+++ branches/bieri_gui/gui_bieri/__init__.py Thu Nov 19 11:35:08 2009
@@ -20,11 +20,40 @@
 #                                                                            
 #
 
###############################################################################
 
+# Deps.
+import dep_check
 
-__all__ = ['relaxGUI']
+# Python module imports.
+import sys
+if dep_check.wx_module:
+    import wx
+
+# relax module imports.
+from relax_errors import RelaxError
+from relax_gui import main
+
+
+__all__ = ['relax_gui']
 
 __doc__ = \
 """Package for the Bieri GUI interface for relax.
 
 This GUI was announced in the post at 
https://mail.gna.org/public/relax-devel/2009-11/msg00005.html.
 """
+
+# Execute the GUI.
+def run():
+    """Build the Bieri GUI for relax."""
+
+    # Dependency check.
+    if not dep_check.wx_module:
+        sys.stderr.write("Please install the wx Python module to access the 
Bieri GUI.\n\n")
+        sys.exit()
+
+    # Build the GUI.
+    relaxGUI = wx.PySimpleApp(0)
+    wx.InitAllImageHandlers()
+    relaxGUI_main = main(None, -1, "")
+    relaxGUI.SetTopWindow(relaxGUI_main)
+    relaxGUI_main.Show()
+    relaxGUI.MainLoop()

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=9886&r1=9885&r2=9886&view=diff
==============================================================================
--- branches/bieri_gui/gui_bieri/relax_gui.py (original)
+++ branches/bieri_gui/gui_bieri/relax_gui.py Thu Nov 19 11:35:08 2009
@@ -4139,13 +4139,3 @@
         choice = self.list_modelfree.GetStringSelection()
         see_results(choice)
         event.Skip()
-
-# end of class main
-
-
-relaxGUI = wx.PySimpleApp(0)
-wx.InitAllImageHandlers()
-relaxGUI_main = main(None, -1, "")
-relaxGUI.SetTopWindow(relaxGUI_main)
-relaxGUI_main.Show()
-relaxGUI.MainLoop()

Modified: branches/bieri_gui/relax
URL: 
http://svn.gna.org/viewcvs/relax/branches/bieri_gui/relax?rev=9886&r1=9885&r2=9886&view=diff
==============================================================================
--- branches/bieri_gui/relax (original)
+++ branches/bieri_gui/relax Thu Nov 19 11:35:08 2009
@@ -50,6 +50,7 @@
 
 # relax modules.
 import generic_fns
+import gui_bieri
 from prompt.gpl import gpl
 from prompt import interpreter
 import relax_errors
@@ -129,7 +130,8 @@
 
         # Execute the Bieri GUI.
         elif mode == 'gui_bieri':
-            self.gui_bieri.run()
+            self.gui = gui_bieri
+            self.gui.run()
 
         # Execute the relax test suite
         elif mode == 'test suite':




Related Messages


Powered by MHonArc, Updated Thu Nov 19 12:00:02 2009