1 | #!/usr/bin/env python |
---|
2 | # -*- coding: utf-8 -*- |
---|
3 | #GSASII |
---|
4 | ########### SVN repository information ################### |
---|
5 | # $Date: 2019-03-19 14:18:53 +0000 (Tue, 19 Mar 2019) $ |
---|
6 | # $Author: vondreele $ |
---|
7 | # $Revision: 3858 $ |
---|
8 | # $URL: trunk/GSASII.py $ |
---|
9 | # $Id: GSASII.py 3858 2019-03-19 14:18:53Z vondreele $ |
---|
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, does some minor initialization |
---|
17 | and then launches :func:`GSASIIdataGUI.GSASIImain`, |
---|
18 | which creates a wx.Application that in turns creates the GUI. |
---|
19 | If the GSAS-II binaries are not installed or are incompatible with |
---|
20 | the OS/Python packages, the user is asked if they should be updated |
---|
21 | from the subversion site. |
---|
22 | ''' |
---|
23 | |
---|
24 | import platform |
---|
25 | import GSASIIpath |
---|
26 | |
---|
27 | __version__ = '1.0.0' |
---|
28 | |
---|
29 | if __name__ == '__main__': |
---|
30 | try: |
---|
31 | GSASIIpath.SetBinaryPath(True) |
---|
32 | except: |
---|
33 | print('Unable to run with current setup, do you want to update to the') |
---|
34 | try: |
---|
35 | if '2' in platform.python_version_tuple()[0]: |
---|
36 | ans = raw_input("latest GSAS-II version? Update ([Yes]/no): ") |
---|
37 | else: |
---|
38 | ans = input("latest GSAS-II version? Update ([Yes]/no): ") |
---|
39 | except: |
---|
40 | ans = 'no' |
---|
41 | if ans.strip().lower() == "no": |
---|
42 | import sys |
---|
43 | print('Exiting') |
---|
44 | sys.exit() |
---|
45 | print('Updating...') |
---|
46 | GSASIIpath.svnUpdateProcess() |
---|
47 | GSASIIpath.SetVersionNumber("$Revision: 3858 $") |
---|
48 | GSASIIpath.InvokeDebugOpts() |
---|
49 | import GSASIIdataGUI as G2gd |
---|
50 | G2gd.GSASIImain() # start the GUI |
---|