source: sasview/guiframe/setup.py @ 07e88d7

ESS_GUIESS_GUI_DocsESS_GUI_batch_fittingESS_GUI_bumps_abstractionESS_GUI_iss1116ESS_GUI_iss879ESS_GUI_iss959ESS_GUI_openclESS_GUI_orderingESS_GUI_sync_sascalccostrafo411magnetic_scattrelease-4.1.1release-4.1.2release-4.2.2release_4.0.1ticket-1009ticket-1094-headlessticket-1242-2d-resolutionticket-1243ticket-1249ticket885unittest-saveload
Last change on this file since 07e88d7 was b90decd, checked in by Mathieu Doucet <doucetm@…>, 15 years ago

guiframe: make sure a default sans.init is created if it doesn't exist.

  • Property mode set to 100644
File size: 1.4 KB
Line 
1"""
2    Installs the guiframe package
3"""
4
5from distutils.core import setup, Extension
6
7from distutils.sysconfig import get_python_lib
8import os, sys
9
10package_dir = { "sans.guiframe":".",
11                "sans.guiframe.local_perspectives":"local_perspectives",
12                "sans.guiframe.local_perspectives.plotting":"local_perspectives/plotting"}
13
14packages = ["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
20if '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
34setup(
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       
Note: See TracBrowser for help on using the repository browser.