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