Changeset 4230 for trunk/makeBat.py


Ignore:
Timestamp:
Jan 3, 2020 12:19:24 PM (22 months ago)
Author:
toby
Message:

more work on gsas2full build

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/makeBat.py

    r4225 r4230  
    1818#   registers the filetype .gpx so that the GSAS-II project files exhibit the
    1919#     GSAS-II icon and so that double-clicking on them opens them in GSAS-II
     20#
    2021import os, sys
    2122import datetime
     
    4849    except ImportError:
    4950        import winreg
    50     app = wx.App()
    51     app.MainLoop()
     51    app = None # delay starting wx until we need it. Likely not needed.
    5252    gsaspath = os.path.split(sys.argv[0])[0]
    5353    if not gsaspath: gsaspath = os.path.curdir
     
    9393    new = False
    9494    oldBat = ''
     95    # this code does not appear to work properly when paths have spaces
    9596    try:
    9697        oldgpx = winreg.OpenKey(winreg.HKEY_CURRENT_USER,r'Software\CLASSES\GSAS-II.project')
     
    106107        try:
    107108            if oldBat != G2bat:
     109                if app is None:
     110                    app = wx.App()
     111                    app.MainLoop()
    108112                dlg = wx.MessageDialog(None,'gpx files already assigned in registry to: \n'+oldBat+'\n Replace with: '+G2bat+'?','GSAS-II gpx in use',
    109113                        wx.YES_NO | wx.ICON_QUESTION)
     
    152156        if win32com.shell.shell.SHGetFileInfo(shortcut,0,0)[0]:
    153157            print('GSAS-II shortcut exists!')
     158            if app is None:
     159                app = wx.App()
     160                app.MainLoop()
    154161            dlg = wx.FileDialog(None, 'Choose new GSAS-II shortcut name',  desktop, shortbase,
    155162                wildcard='GSAS-II shortcut (*.lnk)|*.lnk',style=wx.FD_SAVE|wx.FD_OVERWRITE_PROMPT)
Note: See TracChangeset for help on using the changeset viewer.