mailr15704 - /1.3/gui/relax_gui.py


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

Header


Content

Posted by edward on April 13, 2012 - 16:09:
Author: bugman
Date: Fri Apr 13 16:09:35 2012
New Revision: 15704

URL: http://svn.gna.org/viewcvs/relax?rev=15704&view=rev
Log:
Created a dictionary object containing wxPython version info within the 
status singleton object.

This is being used to construct the Mac dock icon, when the Carbon and Cocoa 
builds and not GTK are
being used.


Modified:
    1.3/gui/relax_gui.py

Modified: 1.3/gui/relax_gui.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/gui/relax_gui.py?rev=15704&r1=15703&r2=15704&view=diff
==============================================================================
--- 1.3/gui/relax_gui.py (original)
+++ 1.3/gui/relax_gui.py Fri Apr 13 16:09:35 2012
@@ -82,6 +82,23 @@
     def __init__(self, parent=None, id=-1, title="", script=None):
         """Initialise the main relax GUI frame."""
 
+        # Store the wxPython info for os/machine/version specific hacks.
+        status.wx_info = {}
+        status.wx_info["version"] = split(wx.__version__, '.')
+        status.wx_info["minor"] = "%s.%s" % (status.wx_info["version"][0], 
status.wx_info["version"][1])
+        status.wx_info["os"] = sys.platform
+        status.wx_info["build"] = None
+        if search('gtk2', wx.version()):
+            status.wx_info["build"] = 'gtk'
+        elif search('cocoa', wx.version()):
+            status.wx_info["build"] = 'cocoa'
+        elif search('mac-unicode', wx.version()):
+            status.wx_info["build"] = 'carbon'
+        status.wx_info["full"] = None
+        if status.wx_info["build"]:
+            status.wx_info["full"] = "%s-%s" % (status.wx_info["os"], 
status.wx_info["build"])
+
+
         # The main window style.
         style = wx.DEFAULT_FRAME_STYLE
         if not status.debug:
@@ -102,7 +119,7 @@
         self.SetIcons(relax_icons)
 
         # Set up the Mac OS X task bar icon.
-        if 'darwin' in sys.platform and not search('gtk2', wx.version()):
+        if status.wx_info["os"] == 'darwin' and status.wx_info["build"] != 
'gtk':
             self.taskbar_icon = Relax_task_bar_icon(self)
 
         # Initialise some variables for the GUI.




Related Messages


Powered by MHonArc, Updated Fri Apr 13 16:40:01 2012