Skip to content
This repository has been archived by the owner on Dec 18, 2020. It is now read-only.

Commit

Permalink
Use zope.browserresource instead of zope.app.publisher.
Browse files Browse the repository at this point in the history
Get rid of zope.app.testing test dependency.
Remove SETUP.CFG and z3c.zrtresource-meta.zcml zcml slug.
  • Loading branch information
nadako committed Aug 27, 2009
1 parent c181509 commit 90cdbd3
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 9 deletions.
9 changes: 7 additions & 2 deletions CHANGES.txt
Expand Up @@ -2,10 +2,15 @@
CHANGES
=======

1.2.1 (unreleased)
1.3.0 (unreleased)
------------------

- Nothing changed yet.
- Use new ``zope.browserresource`` package instead of ``zope.app.publisher``,
as the resources mechanism was moved there to reduce dependencies.

- Get rid of ``zope.app.testing`` test dependency.

- Remove unused SETUP.CFG and z3c.zrtresource-meta.zcml files.


1.2.0 (2009-06-25)
Expand Down
7 changes: 3 additions & 4 deletions setup.py
Expand Up @@ -21,7 +21,7 @@
def read(*rnames):
return open(os.path.join(os.path.dirname(__file__), *rnames)).read()

version = '1.2.1dev'
version = '1.3.0dev'


setup(name='z3c.zrtresource',
Expand Down Expand Up @@ -54,14 +54,13 @@ def read(*rnames):
packages=find_packages('src'),
package_dir = {'': 'src'},
namespace_packages=['z3c'],
extras_require = dict(test=['zope.app.testing',
'zope.testing',
extras_require = dict(test=['zope.testing',
'zope.traversing',
]),
install_requires = ['setuptools',
'zope.site',
'zope.pagetemplate >= 3.5.0',
'zope.app.publisher',
'zope.browserresource',
'zope.component',
'zope.configuration',
'zope.interface',
Expand Down
51 changes: 51 additions & 0 deletions src/z3c/zrtresource/tests.py
@@ -0,0 +1,51 @@
##############################################################################
#
# Copyright (c) 2006 Lovely Systems and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
"""Tag test setup
$Id$
"""
__docformat__ = "reStructuredText"

import doctest
import unittest
import zope.component
from zope.testing import cleanup, doctest
from zope.traversing import testing
from zope.traversing.interfaces import ITraversable
from zope.traversing.namespace import view


def setUp(test):
cleanup.setUp()
testing.setUp()
zope.component.provideAdapter(view, (None, None), ITraversable, name="view")

def tearDown(test):
cleanup.tearDown()


def test_suite():

return unittest.TestSuite((
doctest.DocFileSuite('README.txt',
setUp=setUp,
tearDown=tearDown,
optionflags=doctest.NORMALIZE_WHITESPACE|doctest.ELLIPSIS,
),
doctest.DocFileSuite('zcml.txt',
setUp=lambda test:cleanup.setUp(),
tearDown=tearDown,
optionflags=doctest.NORMALIZE_WHITESPACE|doctest.ELLIPSIS,
),
))
3 changes: 2 additions & 1 deletion src/z3c/zrtresource/zcml.py
Expand Up @@ -21,7 +21,8 @@
from zope.interface import Interface
from zope.publisher.interfaces import browser
from zope.security.checker import CheckerPublic, NamesChecker
from zope.app.publisher.browser import metadirectives, resourcemeta
from zope.browserresource import metadirectives
from zope.browserresource import metaconfigure as resourcemeta

import z3c.zrtresource

Expand Down
9 changes: 7 additions & 2 deletions src/z3c/zrtresource/zrtresource.py
Expand Up @@ -16,9 +16,11 @@
$Id$
"""
__docformat__='restructuredtext'
from zope.browserresource.file import File, FileResource
from zope.browserresource.interfaces import IResourceFactory
from zope.browserresource.interfaces import IResourceFactoryFactory
from zope.interface import implements, classProvides
from zope.site.hooks import getSite
from zope.app.publisher.fileresource import File
from zope.app.publisher.browser.fileresource import FileResource

from z3c.zrtresource import processor, replace

Expand All @@ -33,6 +35,9 @@ def GET(self):


class ZRTFileResourceFactory(object):

implements(IResourceFactory)
classProvides(IResourceFactoryFactory)

def __init__(self, path, checker, name):
self.__file = File(path, name)
Expand Down

0 comments on commit 90cdbd3

Please sign in to comment.