1 | """ |
---|
2 | Installs the guiframe package |
---|
3 | """ |
---|
4 | |
---|
5 | |
---|
6 | from distutils.core import setup, Extension |
---|
7 | |
---|
8 | from distutils.sysconfig import get_python_lib |
---|
9 | import os, sys |
---|
10 | |
---|
11 | package_dir = { "sans.guiframe":".", |
---|
12 | "sans.guiframe.local_perspectives":"local_perspectives", |
---|
13 | "sans.guiframe.local_perspectives.plotting":"local_perspectives/plotting"} |
---|
14 | |
---|
15 | packages = ["sans.guiframe", |
---|
16 | "sans.guiframe.local_perspectives", |
---|
17 | "sans.guiframe.local_perspectives.plotting"] |
---|
18 | |
---|
19 | # Check whether the sans module exists, |
---|
20 | # if not, make sure a default __init__ is created |
---|
21 | if 'install' in sys.argv: |
---|
22 | try: |
---|
23 | lib_dir = get_python_lib() |
---|
24 | danse_init = os.path.join(lib_dir, 'sans', '__init__.py') |
---|
25 | if not os.path.isfile(danse_init): |
---|
26 | if not os.path.isdir("tmp_sans"): |
---|
27 | os.mkdir("tmp_sans") |
---|
28 | f = open("tmp_sans/__init__.py",'w') |
---|
29 | f.close() |
---|
30 | package_dir['sans'] = "tmp_sans" |
---|
31 | packages.append("sans") |
---|
32 | except: |
---|
33 | print "Couldn't create sans/__init__.py\n %s" % sys.exc_value |
---|
34 | |
---|
35 | setup( |
---|
36 | name="guiframe", |
---|
37 | version = "0.1", |
---|
38 | description = "Python module for SANS gui framework", |
---|
39 | author = "University of Tennessee", |
---|
40 | url = "http://danse.chem.utk.edu", |
---|
41 | |
---|
42 | package_dir = package_dir, |
---|
43 | |
---|
44 | packages = packages, |
---|
45 | |
---|
46 | package_data={"sans.guiframe": ['images/*']}, |
---|
47 | ) |
---|
48 | |
---|