source: trunk/GSASIIpath.py @ 230

Last change on this file since 230 was 230, checked in by vondreele, 12 years ago

add svn keywords & add log intensity plotting

  • Property svn:keywords set to Date Author Revision URL Id
File size: 1.3 KB
RevLine 
[65]1# determine a binary path for the pyd files based on the host OS and the python version, 
[170]2# path is relative to location of the script that is called as well as this file
3# this must be imported before anything that imports any .pyd/.so file for GSASII
[65]4import os.path as ospath
5import sys
[181]6import platform
[93]7bindir = None
[65]8if sys.platform == "win32":
[181]9    if platform.architecture()[0] == '64bit':
10        bindir = 'binwin64-%d.%d' % sys.version_info[0:2]
11    else:
12        bindir = 'binwin%d.%d' % sys.version_info[0:2]
[65]13elif sys.platform == "darwin":
14    bindir = 'binmac%d.%d' % sys.version_info[0:2]
[93]15elif sys.platform == "linux2":
16    bindir = 'binlinux%d.%d' % sys.version_info[0:2]
[170]17for loc in sys.path[0],ospath.split(__file__)[0]:
18    if bindir:
19        if ospath.exists(ospath.join(loc,bindir)) and ospath.join(loc,bindir) not in sys.path: 
20            sys.path.insert(0,ospath.join(loc,bindir))
21        # is there a bin directory? (created by a local compile), if so put
22        # that at the top of the path
23    if ospath.exists(ospath.join(loc,'bin')):
24        bindir = 'bin'
25        if ospath.join(loc,'bin') not in sys.path: 
26            sys.path.insert(0,ospath.join(loc,bindir))
[93]27if bindir == None:
28    print "Warning GSAS-II binary libraries not found, some sections of code will not function"
Note: See TracBrowser for help on using the repository browser.