Permalink
Browse files

Added code to handle all the wonderful media files when creating a so…

…urce distribution.
  • Loading branch information...
1 parent 514102a commit 52a79a1492c9d4a7831a57944790bf8cc12e7d7d @jezdez jezdez committed with digi604 Feb 3, 2010
Showing with 36 additions and 2 deletions.
  1. +36 −2 setup.py
View
@@ -1,7 +1,20 @@
from setuptools import setup, find_packages
-import os
+import os, fnmatch
import cms
+media_files = []
+
+for dirpath, dirnames, filenames in os.walk(os.path.join('cms', 'media')):
+ for filename in filenames:
+ filepath = os.path.join(dirpath, filename)
+ failed = False
+ for pattern in ('*.py', '*.pyc', '*~', '.*', '*.bak', '*.swp*'):
+ if fnmatch.fnmatchcase(filename, pattern):
+ failed = True
+ if failed:
+ continue
+ media_files.append(os.path.join(*filepath.split(os.sep)[1:]))
+
setup(
author="Patrick Lauber",
author_email="digi@treepy.com",
@@ -28,6 +41,27 @@
'django (>1.1.0)',
],
packages=find_packages(exclude=["example", "example.*"]),
- include_package_data=True,
+ package_data={
+ 'cms': [
+ 'templates/admin/*.html',
+ 'templates/admin/cms/mail/*.html',
+ 'templates/admin/cms/mail/*.txt',
+ 'templates/admin/cms/page/*.html',
+ 'templates/admin/cms/page/*/*.html',
+ 'templates/cms/*.html',
+ 'templates/cms/*/*.html',
+ 'plugins/*/templates/cms/plugins/*.html',
+ 'plugins/*/templates/cms/plugins/*/*.html',
+ 'plugins/*/templates/cms/plugins/*/*.js',
+ 'locale/*/LC_MESSAGES/*'
+ ] + media_files,
+ 'example': [
+ 'templates/*.html',
+ 'store/templates/store/plugins/*.html',
+ 'sampleapp/media/sampleapp/img/gift.jpg',
+ 'sampleapp/templates/sampleapp/*.html',
+ 'categories/templates/categories/*.html',
+ ]
+ },
zip_safe = False
)

0 comments on commit 52a79a1

Please sign in to comment.