forked from tfgg/magres-format
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
39 lines (31 loc) · 1.22 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/env python
from distutils.core import setup
import os, site, sys
def bin():
return os.path.join(site.USER_BASE, "bin")
def bin_on_path():
return bin() in os.environ['PATH'].split(':')
def find_scripts():
for f in os.listdir("scripts/"):
if f.endswith(".py"):
yield os.path.join("scripts", f)
setup(name='Magres format',
version='0.9',
description='Ab-initio magnetic resonance format',
author='Timothy Green',
author_email='[email protected]',
url='http://www.ccpnc.ac.uk/pmwiki.php/CCPNC/Fileformat',
packages=['magres', 'magres.schema'],
scripts=list(find_scripts()),
)
if not bin_on_path() and "--user" in sys.argv[1:]:
print "\n\nWARNING: Your scripts directory (%s) is not on your PATH" % bin()
shell = os.environ["SHELL"].split('/')[-1]
if shell == "bash":
print "You can fix this by adding the following to your .bashrc and reloading your session"
print "export PATH=%s:$PATH" % bin()
elif shell == "tcsh":
print "You can fix this by adding the following to your .tcshrc and reloading your session"
print "setenv PATH %s:$PATH" % bin()
else:
print "You can fix this by adding %s to your PATH environment variable" % bin()