Skip to content

Commit

Permalink
Merge 2f12b2c into a356178
Browse files Browse the repository at this point in the history
  • Loading branch information
jamadden committed Oct 17, 2017
2 parents a356178 + 2f12b2c commit afc8dfc
Show file tree
Hide file tree
Showing 15 changed files with 305 additions and 170 deletions.
11 changes: 11 additions & 0 deletions .coveragerc
@@ -0,0 +1,11 @@
[run]
source = z3c.template

[report]
precision = 2
exclude_lines =
pragma: no cover
if __name__ == '__main__':
raise NotImplementedError
self.fail
raise AssertionError
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -7,3 +7,5 @@ src/*.egg-info
bin
develop-eggs
parts
.coverage
htmlcov/
20 changes: 14 additions & 6 deletions .travis.yml
@@ -1,12 +1,20 @@
language: python
sudo: false
env:
- TOXENV=py26
- TOXENV=py27
- TOXENV=py33
python:
- 2.7
- 3.4
- 3.5
- 3.6
- pypy
- pypy3
install:
- travis_retry pip install tox
- pip install -U pip setuptools
- pip install -U coverage coveralls
- pip install -U -e .[test]
script:
- tox
- coverage run -m zope.testrunner --test-path=src
after_success:
- coveralls
notifications:
email: false
cache: pip
48 changes: 28 additions & 20 deletions CHANGES.txt → CHANGES.rst
@@ -1,28 +1,36 @@
=======
CHANGES
=======

2.0.1 (unreleased)
------------------

- Nothing changed yet.

=========
CHANGES
=========

3.0.0 (unreleased)
==================

- Add support for PyPy.
- Add support for Python 3.4, 3.5 and 3.6.
- Drop support for Python 2.6 and 3.3.
- Make bound page templates have ``__self__`` and ``__func__``
attributes to be more like Python 3 bound methods. (``im_func`` and
``im_self`` remain available.) See `issue 3
<https://github.com/zopefoundation/z3c.template/issues/3>`_.
- Depend on Chameleon >= 3.0, z3c.pt >= 2.1 and z3c.ptcompat >= 2.1.0
due to possible rendering issues. See `PR 2
<https://github.com/zopefoundation/z3c.template/pull/2>`_.

2.0.0 (2015-11-09)
------------------
==================

- Standardize namespace __init__
- Standardize namespace ``__init__``


2.0.0a2 (2013-02-25)
--------------------
====================

- Make sure the of the templates content type is a native string instead
forced bytes.


2.0.0a1 (2013-02-22)
--------------------
====================

- Added support for Python 3.3.

Expand All @@ -33,15 +41,15 @@ CHANGES


1.4.1 (2012-02-15)
------------------
==================

- Remove hooks to use ViewPageTemplateFile from z3c.pt because this breaks when
z3c.pt is available, but z3c.ptcompat is not included. As recommended by notes
below.


1.4.0 (2011-10-29)
------------------
==================

- Moved z3c.pt include to extras_require chameleon. This makes the package
independent from chameleon and friends and allows to include this
Expand Down Expand Up @@ -74,7 +82,7 @@ CHANGES


1.3.0 (2011-10-28)
------------------
==================

- Update to z3c.ptcompat 1.0 (and as a result, to the z3c.pt 2.x series).

Expand All @@ -83,7 +91,7 @@ CHANGES


1.2.1 (2009-08-22)
------------------
==================

* Corrected description of ``ITemplateDirective.name``.

Expand All @@ -93,7 +101,7 @@ CHANGES


1.2.0 (2009-02-26)
------------------
==================

* Add support for context-specific templates. Now, templates can be
registered and looked up using (view, request, context) triple.
Expand All @@ -109,12 +117,12 @@ CHANGES
instead of retired one.

1.1.0 (2007-10-08)
------------------
==================

* Added an ``IContentTemplate`` interface which is used for
``<z3c:template>``.

1.0.0 (2007-??-??)
------------------
==================

* Initial release.
2 changes: 2 additions & 0 deletions MANIFEST.in
Expand Up @@ -3,6 +3,8 @@ include *.txt
include *.py
include buildout.cfg
include tox.ini
include .travis.yml
include .coveragerc

recursive-include src *

Expand Down
35 changes: 35 additions & 0 deletions README.rst
@@ -0,0 +1,35 @@
==============
z3c.template
==============


.. image:: https://img.shields.io/pypi/v/z3c.template.svg
:target: https://pypi.python.org/pypi/z3c.template/
:alt: Latest release

.. image:: https://img.shields.io/pypi/pyversions/z3c.template.svg
:target: https://pypi.org/project/z3c.template/
:alt: Supported Python versions

.. image:: https://travis-ci.org/zopefoundation/z3c.template.svg?branch=master
:target: https://travis-ci.org/zopefoundation/z3c.template

.. image:: https://coveralls.io/repos/github/zopefoundation/z3c.template/badge.svg?branch=master
:target: https://coveralls.io/github/zopefoundation/z3c.template?branch=master


This package allows you to register templates independently from view code.

In Zope 3, when registering a ``browser:page`` both presentation and computation
are registered together. Unfortunately the registration tangles presentation
and computation so tightly that it is not possible to re-register a different
template depending on context. (You can override the whole registration but
this is not the main point of this package.)

With z3c.template the registration is split up between the view and the
template and allows to differentiate the template based on the skin layer and
the view.

In addition this package lays the foundation to differentiate between
templates that provide specific presentation templates and generic layout
templates.
19 changes: 0 additions & 19 deletions README.txt

This file was deleted.

2 changes: 2 additions & 0 deletions setup.cfg
@@ -0,0 +1,2 @@
[bdist_wheel]
universal = 1
89 changes: 49 additions & 40 deletions setup.py
Expand Up @@ -17,56 +17,68 @@
from setuptools import setup, find_packages

def read(*rnames):
return open(os.path.join(os.path.dirname(__file__), *rnames)).read()
with open(os.path.join(os.path.dirname(__file__), *rnames)) as f:
return f.read()

setup (
CHAMELEON_REQUIRES = [
# Pins because of https://github.com/zopefoundation/z3c.template/pull/2
'chameleon >= 3.0',
'z3c.pt >= 3.1.0',
'z3c.ptcompat >= 2.1.0',

]

TESTS_REQUIRE = CHAMELEON_REQUIRES + [
'zope.testing',
'zope.testrunner',
'zope.traversing',
]

setup(
name='z3c.template',
version='2.0.1.dev0',
author = "Roger Ineichen and the Zope Community",
author_email = "zope-dev@zope.org",
description = "A package implementing advanced Page Template patterns.",
version='3.0.0.dev0',
author="Roger Ineichen and the Zope Community",
author_email="zope-dev@zope.org",
description="A package implementing advanced Page Template patterns.",
long_description=(
read('README.txt')
read('README.rst')
+ '\n\n.. contents::\n\n'+
read('src', 'z3c', 'template', 'README.txt')
read('src', 'z3c', 'template', 'README.rst')
+ '\n' +
read('src', 'z3c', 'template', 'zcml.txt')
read('src', 'z3c', 'template', 'zcml.rst')
+ '\n' +
read('CHANGES.txt')
read('CHANGES.rst')
),
license = "ZPL 2.1",
keywords = "zope3 template layout zpt pagetemplate",
classifiers = [
license="ZPL 2.1",
keywords="zope3 template layout zpt pagetemplate",
classifiers=[
'Development Status :: 5 - Production/Stable',
'Environment :: Web Environment',
'Intended Audience :: Developers',
'License :: OSI Approved :: Zope Public License',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Programming Language :: Python',
'Natural Language :: English',
'Operating System :: OS Independent',
'Topic :: Internet :: WWW/HTTP',
'Framework :: Zope3'],
url = 'https://github.com/zopefoundation/z3c.template',
packages = find_packages('src'),
package_dir = {'':'src'},
namespace_packages = ['z3c'],
extras_require = dict(
test = [
'zope.testing',
'zope.traversing',
],
chameleon = [
'z3c.pt >= 2.1',
'z3c.ptcompat>=1.0',
],
),
install_requires = [
'Framework :: Zope3'
],
url='https://github.com/zopefoundation/z3c.template',
packages=find_packages('src'),
package_dir={'': 'src'},
namespace_packages=['z3c'],
extras_require={
'test': TESTS_REQUIRE,
'chameleon': CHAMELEON_REQUIRES,
},
install_requires=[
'setuptools',
'zope.browserpage',
'zope.component',
Expand All @@ -75,12 +87,9 @@ def read(*rnames):
'zope.pagetemplate',
'zope.publisher',
'zope.schema',
],
tests_require = [
'zope.testing',
'zope.traversing',
],
test_suite = 'z3c.template.tests.test_suite',
include_package_data = True,
zip_safe = False,
)
],
tests_require=TESTS_REQUIRE,
test_suite='z3c.template.tests.test_suite',
include_package_data=True,
zip_safe=False,
)
8 changes: 1 addition & 7 deletions src/z3c/__init__.py
@@ -1,7 +1 @@
# this is a namespace package
try:
import pkg_resources
pkg_resources.declare_namespace(__name__)
except ImportError:
import pkgutil
__path__ = pkgutil.extend_path(__path__, __name__)
__import__('pkg_resources').declare_namespace(__name__) # pragma: no cover

0 comments on commit afc8dfc

Please sign in to comment.