source: trunk/GSASII.py @ 4148

Last change on this file since 4148 was 4148, checked in by toby, 2 years ago

refactor to create wx app before anything else gets done

  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Date Author Revision URL Id
File size: 1.8 KB
RevLine 
[762]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 ###################
[903]11'''
[3858]12*GSAS-II GUI*
[903]13=====================
[762]14
[3858]15This is the script to start the GSAS-II graphical user interface (GUI).
[4148]16This script imports GSASIIpath, which does some minor initialization
17and then (before any wxPython calls can be made) creates a wx.App application.
18A this point :func:`GSASIIpath.SetBinaryPath` is called to establish
19the directory where GSAS-II binaries are found. If the binaries
20are not installed or are incompatible with the OS/Python packages,
21the user is asked if they should be updated from the subversion site.
22The wxPython app is then passed to :func:`GSASIIdataGUI.GSASIImain`,
23which creates the GSAS-II GUI and finally the event loop is started.
[903]24'''
25
[3674]26import platform
[4148]27import wx
[762]28import GSASIIpath
[4148]29GSASIIpath.SetVersionNumber("$Revision: 4148 $")
[762]30
[3000]31__version__ = '1.0.0'
[762]32
33if __name__ == '__main__':
[4148]34    application = wx.App(0) # create the GUI framework
[3123]35    try:
[3420]36        GSASIIpath.SetBinaryPath(True)
[3123]37    except:
38        print('Unable to run with current setup, do you want to update to the')
39        try:
[3674]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): ")               
[3123]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()
[1566]52    GSASIIpath.InvokeDebugOpts()
[3000]53    import GSASIIdataGUI as G2gd   
[4148]54    G2gd.GSASIImain(application) # start the GUI
55    application.MainLoop()
Note: See TracBrowser for help on using the repository browser.