Changeset 1085 for install/bootstrap.py
- Timestamp:
- Oct 4, 2013 4:19:28 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
install/bootstrap.py
r983 r1085 17 17 for pkg in missing: print " ",pkg, 18 18 print 19 print "We suggest installing the Canopy Express package (must be 32 bit ) at\nhttp://www.enthought.com/store"19 print "We suggest installing the Canopy Express package (must be 32 bit for Mac) at\nhttp://www.enthought.com/store" 20 20 sys.exit() 21 21 … … 48 48 # if ans.lower().find('no') > -1: sys.exit() 49 49 repos = 'linux' 50 print 'Linux, Intel-compatible'50 print 'Linux, assuming Intel-compatible' 51 51 elif sys.platform == "darwin" and platform.processor() == 'i386': 52 52 repos = 'osxi86' … … 54 54 elif sys.platform == "darwin": 55 55 repos = 'osxppc' 56 print 'Mac OS X, PowerPC -- you will need to run f2pyon fsource files'56 print 'Mac OS X, PowerPC -- you will need to run scons on fsource files' 57 57 else: 58 print 'Unidentifed platform -- you may need to run f2pyon fsource files'58 print 'Unidentifed platform -- you may need to run scons on fsource files' 59 59 60 60 cmds = ( … … 80 80 # On linux, make desktop icon 81 81 if sys.platform.startswith('linux'): 82 os.chmod(os.path.join(gsaspath, 'GSASII.py'), 83 stat.S_IXUSR | stat.S_IRUSR | stat.S_IRGRP | stat.S_IXGRP | stat.S_IXOTH) 84 if os.path.exists(os.path.expanduser('~/Desktop/')): 85 open(os.path.expanduser('~/Desktop/GSASII.desktop'),'w').write(''' 82 desktop_template = """ 86 83 [Desktop Entry] 87 84 Encoding=UTF-8 … … 89 86 Type=Application 90 87 Terminal=false 91 Exec= %s88 Exec=xterm -hold -e %s 92 89 Name=GSAS-II 93 90 Icon=%s 94 ''' % (os.path.join(gsaspath, 'GSASII.py'),os.path.join(gsaspath, 'gsas2.png'))) 95 os.chmod(os.path.expanduser('~/Desktop/GSASII.desktop'), 96 stat.S_IWUSR | stat.S_IXUSR | stat.S_IRUSR | stat.S_IRGRP | stat.S_IXGRP | stat.S_IXOTH) 91 """ 92 loc = '~/Desktop/' 93 eloc = os.path.expanduser(loc) 94 dfile = os.path.join(eloc,'GSASII.desktop') 95 icon = os.path.join(gsaspath, 'gsas2.png') 96 script = os.path.join(gsaspath, 'GSASII.py') 97 os.chmod(script, # make the .py file executable and readable 98 stat.S_IXUSR | stat.S_IRUSR | stat.S_IRGRP | stat.S_IXGRP | stat.S_IXOTH) 99 if os.path.exists(eloc): 100 open(dfile,'w').write(desktop_template % (script,icon)) 101 os.chmod( 102 dfile, 103 stat.S_IWUSR | stat.S_IXUSR | stat.S_IRUSR | stat.S_IRGRP | stat.S_IXGRP | stat.S_IXOTH) 104 print("created GNOME desktop shortcut "+dfile)
Note: See TracChangeset
for help on using the changeset viewer.