Changeset c22305e in sasview


Ignore:
Timestamp:
Jun 9, 2011 1:45:17 PM (14 years ago)
Author:
Gervaise Alina <gervyh@…>
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:
8d82a1a
Parents:
3dee08e
Message:

edit setup.py for guiframe to add package data for sdist command

File:
1 edited

Legend:

Unmodified
Added
Removed
  • guiframe/setup.py

    r3291855 rc22305e  
     1 
    12""" 
    23    Installs the guiframe package 
     
    910import os 
    1011import sys 
     12import glob 
    1113 
    1214     
     
    1416package_dir = { "sans.guiframe":".", 
    1517                "sans.guiframe.local_perspectives":"local_perspectives", 
    16                 "sans.guiframe.widgets":"widgets", 
    17                 "sans.guiframe.media":"media"} 
    18 package_data = {"sans.guiframe": ['images/*'], 
    19                 "sans.guiframe.media": ['*']} 
     18                #"sans.guiframe.images":"images", 
     19               # "sans.guiframe.media":"media", 
     20                } 
     21#package_data = {"sans.guiframe": ['images/*'], 
     22#                "sans.guiframe":'media/*']} 
     23package_data = {"sans.guiframe": ['images/*', 'media/*']} 
    2024packages = ["sans.guiframe",  
    21             "sans.guiframe.local_perspectives", 
    22             "sans.guiframe.widgets", 
    23             "sans.guiframe.media"] 
     25            "sans.guiframe.local_perspectives"] 
    2426# build local plugin 
    2527for dir in os.listdir(path): 
     
    5557 
    5658    packages = packages, 
    57      
    5859    package_data = package_data, 
     60 
    5961    ) 
    60          
     62if 'sdist' in sys.argv: 
     63    import zipfile 
     64    from distutils.filelist import findall 
     65    filename = "guiframe-0.9" 
     66    cwd = os.getcwd() 
     67    for f in findall(cwd): 
     68        if os.path.basename(f).count(filename) == 1: 
     69            if zipfile.is_zipfile(f): 
     70                zfile = zipfile.ZipFile(f, "a") 
     71                for image_file in glob.glob(os.path.join("images","*")): 
     72                    print "Adding %s to %s\n" % (image_file, os.path.basename(f)) 
     73                    zfile.write(image_file, os.path.join(filename, image_file)) 
     74                for media_file in glob.glob(os.path.join("media","*")): 
     75                    print "Adding %s to %s\n" % (media_file, os.path.basename(f)) 
     76                    zfile.write(media_file, os.path.join(filename, media_file)) 
     77                zfile.close() 
     78                break 
     79                     
Note: See TracChangeset for help on using the changeset viewer.