-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Trying a different approach to including templates.
- Loading branch information
1 parent
ce1ccb0
commit 3fcde7e
Showing
1 changed file
with
45 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | |||
|
|