Changeset 3162 for trunk/setup.py

Show
Ignore:
Timestamp:
06/06/2007 01:38:37 PM (2 years ago)
Author:
paul
Message:

Fix setup.py to include the icon theme directories in the python egg.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/setup.py

    r2412 r3162  
     1import os 
     2import glob 
    13import ez_setup # From http://peak.telecommunity.com/DevCenter/setuptools 
    24ez_setup.use_setuptools() 
     
    68 
    79daboVersion = version["version"] 
     10 
     11# List the paths under dabo/icon/themes: 
     12iconDir = "dabo/icons/themes" 
     13iconDirs = {} 
     14def getIconSubDir(arg, dirname, fnames): 
     15    if ".svn" not in dirname and "cards" not in dirname.lower() and dirname[-1] != "\\": 
     16        icons = glob.glob(os.path.join(dirname, "*.png")) 
     17        if icons: 
     18            subdir = os.path.join(iconDir, dirname[len(arg)+1:]) 
     19            subdir = subdir.replace(os.sep, ".") 
     20            iconDirs[subdir] = ["*.png"] 
     21os.path.walk(iconDir, getIconSubDir, iconDir) 
     22 
     23package_data = { 
     24        '':['ANNOUNCE', 'AUTHORS', 'ChangeLog', 'INSTALL', 
     25        'LICENSE.TXT', 'README', 'TODO'], 
     26        'dabo.icons': ['*.png', '*.ico'], 
     27        'dabo.icons.cards.small': ['*.png', '*.ico'], 
     28        'dabo.icons.cards.large': ['*.png', '*.ico'], 
     29        'dabo.lib.reporting':['*.rfxml'], 
     30        'dabo.lib.reporting_stefano':['*.rfxml'], 
     31        'dabo.ui.uiwx.macImageProblem':['*.png'], 
     32        'dabo.ui.uiwx.masked':['README'], 
     33        } 
     34 
     35package_data.update(iconDirs) 
     36 
    837 
    938setup( 
     
    1645        license = 'MIT', 
    1746        packages = find_packages(), 
    18         package_data = { 
    19                 '':['ANNOUNCE', 'AUTHORS', 'ChangeLog', 'INSTALL', 
    20                 'LICENSE.TXT', 'README', 'TODO'], 
    21                 'dabo.icons': ['*.png', '*.ico'], 
    22                 'dabo.icons.cards.small': ['*.png', '*.ico'], 
    23                 'dabo.icons.cards.large': ['*.png', '*.ico'], 
    24                 'dabo.lib.reporting':['*.rfxml'], 
    25                 'dabo.lib.reporting_stefano':['*.rfxml'], 
    26                 'dabo.ui.uiwx.macImageProblem':['*.png'], 
    27                 'dabo.ui.uiwx.masked':['README'], 
    28         }, 
     47        package_data = package_data, 
    2948)