Skip to content

Commit

Permalink
Trying a different approach to including templates.
Browse files Browse the repository at this point in the history
  • Loading branch information
georgedorn committed Sep 23, 2011
1 parent ce1ccb0 commit 3fcde7e
Showing 1 changed file with 45 additions and 12 deletions.
57 changes: 45 additions & 12 deletions setup.py
Original file line number Original file line Diff line number Diff line change
@@ -1,16 +1,49 @@
from setuptools import setup, find_packages import os
from distutils.core import setup


setup(
name="Blogy",
version="0.1",
packages=find_packages(),


install_requires=['django-taggit', def fullsplit(path, result=None):
'django-markitup', """
'pygments', Split a pathname into components (the opposite of os.path.join) in a
'docutils', platform-neutral way.
], """
if result is None:
result = []
head, tail = os.path.split(path)
if head == "":
return [tail] + result
if head == path:
return result
return fullsplit(head, [tail] + result)


include_package_data = True,
) package_dirs = ["blogy", 'themes']


packages = []
for package_dir in package_dirs:
for dirpath, dirnames, filenames in os.walk(package_dir):
# ignore dirnames that start with '.'
for i, dirname in enumerate(dirnames):
if dirname.startswith("."):
del dirnames[i]
if "__init__.py" in filenames:
packages.append(".".join(fullsplit(dirpath)))

template_patterns = [
'templates/*.html',
'templates/*/*.html',
'templates/*/*/*.html',
]

package_data = dict(
(package_name, template_patterns)
for package_name in packages
)

setup(name='django-blogy',
version='0.1',
description='Blogy',
packages=packages,
package_data=package_data)


0 comments on commit 3fcde7e

Please sign in to comment.