from src import version from distutils.core import setup import py2exe import sys import os import glob ############### # For matplotlib from matplotlib import get_data_path def mplfiles(dirname, basename): allfiles = [] myfiles = [] for filename in os.listdir(dirname): fullpath = os.path.join(dirname, filename) if os.path.isfile(fullpath): myfiles.append(fullpath) elif os.path.isdir(fullpath): newbasename = os.path.join(basename, filename) allfiles += mplfiles(fullpath, newbasename) if myfiles: allfiles.append((basename, myfiles)) return allfiles mpldata = mplfiles(get_data_path(), 'matplotlibdata') ################## # For wxPython def get_msvcp71dll(): '''Get location of msvcp71.dll for wx''' for path in sys.path: globpath = os.path.join(path, 'wx', 'msvcp71.dll') files = glob.glob(globpath) if files: return files[0] msvcp = [get_msvcp71dll()] setup( version = version, description = "", name = "Ruokintojenvalvontaohjelma", data_files = [('', msvcp), ('locale', ['locale/finnish.mo']), ('', ['ruokinta.exe.manifest'])] + mpldata, options = {'py2exe': {'packages' : ['matplotlib', 'pytz'], 'dll_excludes': ['msvcp71.dll']}}, # targets to build windows = [{ 'script': "ruokinta.py", 'icon_resources': [(0, "ruokinta.ico")], }] )