1 | #!/usr/bin/env python |
---|
2 | # -*- coding: utf-8 -*- |
---|
3 | #GSASII |
---|
4 | ########### SVN repository information ################### |
---|
5 | # $Date: 2019-09-13 22:06:45 +0000 (Fri, 13 Sep 2019) $ |
---|
6 | # $Author: toby $ |
---|
7 | # $Revision: 4148 $ |
---|
8 | # $URL: trunk/GSASII.py $ |
---|
9 | # $Id: GSASII.py 4148 2019-09-13 22:06:45Z toby $ |
---|
10 | ########### SVN repository information ################### |
---|
11 | ''' |
---|
12 | *GSAS-II GUI* |
---|
13 | ===================== |
---|
14 | |
---|
15 | This is the script to start the GSAS-II graphical user interface (GUI). |
---|
16 | This script imports GSASIIpath, which does some minor initialization |
---|
17 | and then (before any wxPython calls can be made) creates a wx.App application. |
---|
18 | A this point :func:`GSASIIpath.SetBinaryPath` is called to establish |
---|
19 | the directory where GSAS-II binaries are found. If the binaries |
---|
20 | are not installed or are incompatible with the OS/Python packages, |
---|
21 | the user is asked if they should be updated from the subversion site. |
---|
22 | The wxPython app is then passed to :func:`GSASIIdataGUI.GSASIImain`, |
---|
23 | which creates the GSAS-II GUI and finally the event loop is started. |
---|
24 | ''' |
---|
25 | |
---|
26 | import platform |
---|
27 | import wx |
---|
28 | import GSASIIpath |
---|
29 | GSASIIpath.SetVersionNumber("$Revision: 4148 $") |
---|
30 | |
---|
31 | __version__ = '1.0.0' |
---|
32 | |
---|
33 | if __name__ == '__main__': |
---|
34 | application = wx.App(0) # create the GUI framework |
---|
35 | try: |
---|
36 | GSASIIpath.SetBinaryPath(True) |
---|
37 | except: |
---|
38 | print('Unable to run with current setup, do you want to update to the') |
---|
39 | try: |
---|
40 | if '2' in platform.python_version_tuple()[0]: |
---|
41 | ans = raw_input("latest GSAS-II version? Update ([Yes]/no): ") |
---|
42 | else: |
---|
43 | ans = input("latest GSAS-II version? Update ([Yes]/no): ") |
---|
44 | except: |
---|
45 | ans = 'no' |
---|
46 | if ans.strip().lower() == "no": |
---|
47 | import sys |
---|
48 | print('Exiting') |
---|
49 | sys.exit() |
---|
50 | print('Updating...') |
---|
51 | GSASIIpath.svnUpdateProcess() |
---|
52 | GSASIIpath.InvokeDebugOpts() |
---|
53 | import GSASIIdataGUI as G2gd |
---|
54 | G2gd.GSASIImain(application) # start the GUI |
---|
55 | application.MainLoop() |
---|