Haarcascades included into dist repo, for use with the executable. Input data to be removed from github (and included only in archives)

This commit is contained in:
2012-05-23 07:44:11 +02:00
parent b203f61838
commit 92b9905ede
3 changed files with 38 additions and 4 deletions

3
.gitignore vendored
View File

@@ -1,4 +1,5 @@
*.pyc
data/output/*
data/*
build
dist
MANIFEST

View File

@@ -1,3 +1,4 @@
recursive-include test *.py
recursive-include data\input\sample *
recursive-include data\output
recursive-include data\output
recursive-include facemovie\haarcascades *.xml

View File

@@ -5,15 +5,46 @@ Created on 19 avr. 2012
'''
# creating executable here
from distutils.core import setup
import py2exe, sys, os
import sys
import os
import glob
import py2exe
import facemovie
sys.argv.append('py2exe')
def find_data_files(source,target,patterns):
"""Locates the specified data-files and returns the matches
in a data_files compatible format.
source is the root of the source data tree.
Use '' or '.' for current directory.
target is the root of the target data tree.
Use '' or '.' for the distribution directory.
patterns is a sequence of glob-patterns for the
files you want to copy.
"""
if glob.has_magic(source) or glob.has_magic(target):
raise ValueError("Magic not allowed in src, target")
ret = {}
for pattern in patterns:
pattern = os.path.join(source,pattern)
for filename in glob.glob(pattern):
if os.path.isfile(filename):
targetpath = os.path.join(target,os.path.relpath(filename,source))
path = os.path.dirname(targetpath)
ret.setdefault(path,[]).append(filename)
return sorted(ret.items())
# Utility function to read the README file.
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
haar_files = find_data_files('facemovie','',['haarcascades/*.xml'])
print haar_files
setup(
name = "Facemovie",
version = "0.4",
@@ -25,7 +56,7 @@ setup(
url = "https://github.com/jlengrand/FaceMovie",
download_url = "https://github.com/jlengrand/FaceMovie", # FIXME : To be updated
packages=['facemovie', 'facemovie.lib', 'facemovie.haarcascades'],
package_data={'facemovie': ['haarcascades/*.xml']}, # Adds xml files to the lib
#package_data={'facemovie': ['haarcascades/*.xml']}, # Adds xml files to the lib
long_description=read('README.markdown'),
classifiers=[
"Development Status :: 3 - Alpha",
@@ -38,6 +69,7 @@ setup(
"Programming Language :: Python :: 2 :: Only",
],
platforms ={"Linux"},
data_files = haar_files,
options = {'py2exe': {'bundle_files': 1, 'includes': ['numpy'] } },
console=['facemovie/Facemoviefier.py'],
zipfile = None,