From 6e2a572771baf507021787b029d777649764f440 Mon Sep 17 00:00:00 2001 From: Diederik van der Boor Date: Mon, 5 Dec 2011 22:28:13 +0100 Subject: [PATCH] Add packaging files to make it installable. --- AUTHORS | 13 +++++++++++++ LICENSE | 28 ++++++++++++++++++++++++++++ MANIFEST.in | 3 +++ README.rst | 35 +++++++++++++++++++++++++++++++++++ setup.py | 35 +++++++++++++++++++++++++++++++++++ template_analyzer/__init__.py | 1 + 6 files changed, 115 insertions(+) create mode 100644 AUTHORS create mode 100644 LICENSE create mode 100644 MANIFEST.in create mode 100644 README.rst create mode 100755 setup.py diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..277b16b --- /dev/null +++ b/AUTHORS @@ -0,0 +1,13 @@ +Packaging in separate application: + +* Diederik van der Boor + +Original code written by Django CMS developers and contributors: + +* Chris Glass +* Jonas Obrist +* Patrick Lauber +* Paul van der Linden +* "philomat" +* Stephan Jaekel +* Tanel Külaots diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..e56d3d7 --- /dev/null +++ b/LICENSE @@ -0,0 +1,28 @@ +Copyright (c) 2008, Batiste Bieler +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of the author nor the names of other + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..29ab8cc --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,3 @@ +include AUTHORS +include README.rst +include LICENSE diff --git a/README.rst b/README.rst new file mode 100644 index 0000000..5912869 --- /dev/null +++ b/README.rst @@ -0,0 +1,35 @@ +Introduction +============ + +The ``template_analyzer`` package offers an API to analyze the Django template structure. +It can be used to find nodes of a particular type, e.g. to do automatic detection of placeholder tags. + +API example +========== + +:: + from template_analyzer.djangoanalyzer import find_node_instances + from mypackage.templatetags.placeholdertags import Placeholder + + template = get_template("mycms/default-page.html") + + placeholders = find_node_instances(template, Placeholder) + placeholder_names = [p.get_name() for p in placeholders] + +Installation +============ + +First install the module, preferably in a virtual environment. It can be installed from PyPI:: + + pip install django-template-analyzer + +Or the current folder can be installed:: + + pip install . + +Credits +======= + +* This package is based on the work of + `Django CMS `_. +* Many thanks to the contributors of ``cms/utils/plugins.py`` in Django CMS! diff --git a/setup.py b/setup.py new file mode 100755 index 0000000..5821dc2 --- /dev/null +++ b/setup.py @@ -0,0 +1,35 @@ +#!/usr/bin/env python +from setuptools import setup, find_packages +from os.path import dirname, join + +setup( + name='django-template-analyzer', + version='1.0.0', + license='BSD License', + platforms=['OS Independent'], + + description='Django Template Analyzer - Extract template nodes from a Django template', + long_description=open(join(dirname(__file__), 'README.rst')).read(), + + author='Diederik van der Boor & Django CMS developers', + author_email='opensource@edoburu.nl', + + url='https://github.com/edoburu/django-template-analyzer', + download_url='https://github.com/edoburu/django-template-analyzer/zipball/master', + + packages=find_packages(), + include_package_data=True, + + zip_safe=False, + classifiers=[ + 'Development Status :: 5 - Production/Stable', + 'Environment :: Web Environment', + 'Intended Audience :: Developers', + 'License :: OSI Approved :: BSD License', + 'Operating System :: OS Independent', + 'Programming Language :: Python', + 'Framework :: Django', + 'Topic :: Software Development', + 'Topic :: Software Development :: Libraries :: Application Frameworks', + ] +) diff --git a/template_analyzer/__init__.py b/template_analyzer/__init__.py index 466e097..832cff1 100644 --- a/template_analyzer/__init__.py +++ b/template_analyzer/__init__.py @@ -1 +1,2 @@ from .djangoanalyzer import find_node_instances +VERSION = (1,0,0)