Changeset 24


Ignore:
Timestamp:
Feb 4, 2010 5:21:18 PM (12 years ago)
Author:
toby
Message:

add error mesages, fix import by making relative to source location, not working dir

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASII.py

    r23 r24  
    1515else:
    1616    import wxmpl as wxmpl
    17 
    18 # determine a binary path pased on the host OS and the python version
     17import pylab
     18
     19# determine a binary path pased on the host OS and the python version, path is relative to
     20# location of this file
    1921if sys.platform == "win32":
    2022    bindir = 'binwin%d.%d' % sys.version_info[0:2]
     
    2325else:
    2426    bindir = 'bin'
    25 if ospath.exists(ospath.abspath(bindir)): sys.path.insert(0,ospath.abspath(bindir))
    26 import pylab
    27 
     27if ospath.exists(ospath.join(sys.path[0],bindir)): sys.path.insert(0,ospath.join(sys.path[0],bindir))
     28# load the GSAS routines
    2829import GSASIIIO as G2IO
    2930import GSASIIcomp as G2cmp
  • trunk/GSASIIIO.py

    r22 r24  
    443443    import array as ar
    444444    import struct as st
    445     import pack_f as pf
     445    try:
     446        import pack_f as pf
     447    except:
     448        msg = wx.MessageDialog(None, message="Unable to load the GSAS MAR image decompression, pack_f",
     449                               caption="Import Error",
     450                               style=wx.ICON_ERROR | wx.OK | wx.STAY_ON_TOP)
     451        msg.ShowModal()
     452        return None,None,None,None
     453
    446454    print 'Read Mar345 file: ',filename
    447455    File = open(filename,'rb')
  • trunk/GSASIIcomp.py

    r9 r24  
    77import numpy.linalg as nl
    88import GSASIIgrid as G2gd
    9 import pypowder as pyp
     9try:
     10    import pypowder as pyp
     11except:
     12    # create an app to display the error, since we are still loading routines at this point
     13    app = wx.App()
     14    app.MainLoop()
     15    msg = wx.MessageDialog(None, message="Unable to load the GSAS powder computation module, pypowder",
     16                     caption="Import Error",
     17                     style=wx.ICON_ERROR | wx.OK | wx.STAY_ON_TOP)
     18    msg.ShowModal()
     19    # this error is non-recoverable, so just quit
     20    exit()
    1021
    1122# trig functions in degrees
Note: See TracChangeset for help on using the changeset viewer.