Changeset 539


Ignore:
Timestamp:
Apr 13, 2012 2:08:57 PM (10 years ago)
Author:
toby
Message:

install OpenGL if not installed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASII.py

    r537 r539  
    2626import wx.lib.inspection as wxeye
    2727
     28try:
     29    import OpenGL as ogl
     30except ImportError:
     31    from setuptools.command import easy_install
     32    print("OpenGL wwas not found. Will attempt to load the package.")
     33    def install_with_easyinstall(package):
     34        easy_install.main(["-U", package])
     35    install_with_easyinstall('PyOpenGl')
     36    print("OpenGL has been installed. Please restart GSAS-II again")
     37    sys.exit()
     38
    2839# load the GSAS routines
    2940import GSASIIpath
     
    3647import GSASIImapvars as G2mv
    3748import GSASIIsolve as G2sol
    38 import OpenGL as ogl
    3949
    4050#wx inspector - use as needed
     
    205215            finally:
    206216                if fp: fp.close()
    207 #        item = parent.Append(wx.ID_ANY, help='Import phase data',
    208 #                      kind=wx.ITEM_NORMAL,text='Import Phase (generic)...')
    209 #        self.Bind(wx.EVT_MENU, self.OnImportPhaseGeneric, id=item.GetId())
    210217        submenu = wx.Menu()
    211218        item = parent.AppendMenu(wx.ID_ANY, 'Import Phase menu',
    212219            submenu, help='Import phase data')
    213220        self.PhaseImportMenuId = {}
     221        item = submenu.Append(wx.ID_ANY,
     222                              help='Import phase data based selected by extension',
     223                              kind=wx.ITEM_NORMAL,text='Import Phase by extension')
     224        self.Bind(wx.EVT_MENU, self.OnImportPhaseGeneric, id=item.GetId())
    214225        for reader in self.ImportPhaseReaderlist:
    215226            item = submenu.Append(wx.ID_ANY,
Note: See TracChangeset for help on using the changeset viewer.