Changeset 1239


Ignore:
Timestamp:
Dec 4, 2013 4:26:39 PM (12 years ago)
Author:
toby
Message:

mac script to make a launch app now runs in 2.6

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/makeMacApp.py ΒΆ

    r1238 r1239  
    190190    f.close()
    191191
    192     try:
    193         subprocess.check_output(["osacompile","-o",apppath,shell],stderr=subprocess.STDOUT)
    194     except subprocess.CalledProcessError, msg:
    195         print('Error compiling AppleScript.\n'+
    196               'Report the next message along with details about your Mac to toby@anl.gov')
    197         print(msg.output)
    198         sys.exit()
    199 
     192    if sys.version_info[0]+sys.version_info[1]/10. >= 2.7:
     193        try:
     194            subprocess.check_output(["osacompile","-o",apppath,shell],stderr=subprocess.STDOUT)
     195        except subprocess.CalledProcessError, msg:
     196            print('Error compiling AppleScript.\n'+
     197                  'Report the next message along with details about your Mac to toby@anl.gov')
     198            print(msg.output)
     199            sys.exit()
     200    else:
     201        try:
     202            subprocess.call(["osacompile","-o",apppath,shell])
     203        except Exception, msg:
     204            print('Error compiling AppleScript in python <=2.6\n'+
     205                  'Report the next message along with details about your Mac to toby@anl.gov')
     206            print(msg)
     207            sys.exit()
    200208    # change the icon
    201209    oldicon = os.path.join(apppath,"Contents","Resources","droplet.icns")
Note: See TracChangeset for help on using the changeset viewer.