Changeset b90decd in sasview for guiframe


Ignore:
Timestamp:
Jul 4, 2009 4:11:48 PM (15 years ago)
Author:
Mathieu Doucet <doucetm@…>
Branches:
master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
96c430d
Parents:
6fea919
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • guiframe/setup.py

    rbd36da6b rb90decd  
    44 
    55from 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 
    633 
    734setup( 
     
    1239    url = "http://danse.chem.utk.edu", 
    1340     
    14     package_dir = { "sans.guiframe":".", 
    15                     "sans.guiframe.local_perspectives":"local_perspectives", 
    16                     "sans.guiframe.local_perspectives.plotting":"local_perspectives/plotting"}, 
    17      
    18     packages = ["sans.guiframe",  
    19                 "sans.guiframe.local_perspectives", 
    20                 "sans.guiframe.local_perspectives.plotting"], 
     41    package_dir = package_dir, 
     42 
     43    packages = packages, 
    2144     
    2245    package_data={"sans.guiframe": ['images/*']}, 
Note: See TracChangeset for help on using the changeset viewer.