[Checkins] SVN: zc.resourcelibrary/tags/1.0.2/ Tag 1.0.2

Dan Korostelev nadako at gmail.com
Tue Jan 27 05:02:05 EST 2009


Log message for revision 95103:
  Tag 1.0.2

Changed:
  A   zc.resourcelibrary/tags/1.0.2/
  D   zc.resourcelibrary/tags/1.0.2/CHANGES.txt
  A   zc.resourcelibrary/tags/1.0.2/CHANGES.txt
  D   zc.resourcelibrary/tags/1.0.2/setup.py
  A   zc.resourcelibrary/tags/1.0.2/setup.py
  D   zc.resourcelibrary/tags/1.0.2/src/zc/resourcelibrary/zcml.py
  A   zc.resourcelibrary/tags/1.0.2/src/zc/resourcelibrary/zcml.py

-=-
Deleted: zc.resourcelibrary/tags/1.0.2/CHANGES.txt
===================================================================
--- zc.resourcelibrary/trunk/CHANGES.txt	2009-01-27 09:44:48 UTC (rev 95096)
+++ zc.resourcelibrary/tags/1.0.2/CHANGES.txt	2009-01-27 10:02:04 UTC (rev 95103)
@@ -1,74 +0,0 @@
-=======
-CHANGES
-=======
-
-1.0.1 (2008-03-07)
-------------------
-
-Bugs fixed:
-
-- added the behavior from the standard Zope 3 response to guess that a body
-  that is not HTML without an explicit mimetype should have a
-  'text/plain' mimetype.  This means that, for instance, redirects with
-  a body of '' and no explicit content type will no longer cause an
-  exception in the resourcelibrary response code.
-
-1.0.0 (2008-02-17)
-------------------
-
-New features:
-
-- You can now provide an alternative "directory-resource"
-  factory. This facilitates implementation of dynamic resources.
-
-
-Bugs fixed:
-
-- Updated the functional-testing zcml file to get rid of a deprication
-  warning.
-
-
-0.8.2 (2007-12-07)
-------------------
-
-- bug fix: when checking content type, take into account that it may be None
-
-0.8.1 (2007-12-05)
-------------------
-
-- changed MIME type handling to be more restrictive about whitespace to
-  conform to RfC 2045
-
-0.8 (2007-12-04)
-----------------
-
-- fixed the check for HTML and XML content to allow content type parameters
-
-0.6.1 (2007-11-03)
-------------------
-
-- Update package meta-data.
-
-- Fixed package dependencies.
-
-- Merged functional and unit tests.
-
-0.6.0 (2006-09-22)
-------------------
-
-???
-
-0.5.2 (2006-06-15)
-------------------
-
-- Add more package meta-data.
-
-0.5.1 (2006-06-06)
-------------------
-
-- Update package code to work with newer versions of other packages.
-
-0.5.0 (2006-04-24)
-------------------
-
-- Initial release.

Copied: zc.resourcelibrary/tags/1.0.2/CHANGES.txt (from rev 95099, zc.resourcelibrary/trunk/CHANGES.txt)
===================================================================
--- zc.resourcelibrary/tags/1.0.2/CHANGES.txt	                        (rev 0)
+++ zc.resourcelibrary/tags/1.0.2/CHANGES.txt	2009-01-27 10:02:04 UTC (rev 95103)
@@ -0,0 +1,85 @@
+=======
+CHANGES
+=======
+
+1.0.2 (2009-01-27)
+------------------
+
+- Remove zope.app.zapi from dependencies, substituting
+  its uses with direct imports.
+
+- Use zope-dev at zope.org mailing list address instead of
+  zope3-dev at zope.org as the latter one is retired.
+
+- Change "cheeseshop" to "pypi" in the package homepage.
+
+1.0.1 (2008-03-07)
+------------------
+
+Bugs fixed:
+
+- added the behavior from the standard Zope 3 response to guess that a body
+  that is not HTML without an explicit mimetype should have a
+  'text/plain' mimetype.  This means that, for instance, redirects with
+  a body of '' and no explicit content type will no longer cause an
+  exception in the resourcelibrary response code.
+
+1.0.0 (2008-02-17)
+------------------
+
+New features:
+
+- You can now provide an alternative "directory-resource"
+  factory. This facilitates implementation of dynamic resources.
+
+
+Bugs fixed:
+
+- Updated the functional-testing zcml file to get rid of a deprication
+  warning.
+
+
+0.8.2 (2007-12-07)
+------------------
+
+- bug fix: when checking content type, take into account that it may be None
+
+0.8.1 (2007-12-05)
+------------------
+
+- changed MIME type handling to be more restrictive about whitespace to
+  conform to RfC 2045
+
+0.8 (2007-12-04)
+----------------
+
+- fixed the check for HTML and XML content to allow content type parameters
+
+0.6.1 (2007-11-03)
+------------------
+
+- Update package meta-data.
+
+- Fixed package dependencies.
+
+- Merged functional and unit tests.
+
+0.6.0 (2006-09-22)
+------------------
+
+???
+
+0.5.2 (2006-06-15)
+------------------
+
+- Add more package meta-data.
+
+0.5.1 (2006-06-06)
+------------------
+
+- Update package code to work with newer versions of other packages.
+
+0.5.0 (2006-04-24)
+------------------
+
+- Initial release.

Deleted: zc.resourcelibrary/tags/1.0.2/setup.py
===================================================================
--- zc.resourcelibrary/trunk/setup.py	2009-01-27 09:44:48 UTC (rev 95096)
+++ zc.resourcelibrary/tags/1.0.2/setup.py	2009-01-27 10:02:04 UTC (rev 95103)
@@ -1,80 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2007 Zope Corporation 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.
-#
-##############################################################################
-"""Setup for zc.resourcelibrary package
-
-$Id: setup.py 81038 2007-10-24 14:34:17Z srichter $
-"""
-import os
-from setuptools import setup, find_packages
-
-def read(*rnames):
-    return open(os.path.join(os.path.dirname(__file__), *rnames)).read()
-
-setup(name='zc.resourcelibrary',
-      version = '1.0.1',
-      author='Zope Corporation and Contributors',
-      author_email='zope3-dev at zope.org',
-      description='Post-rendering Resource Inclusion',
-      long_description=(
-          read('README.txt')
-          + '\n\n' +
-          'Detailed Dcoumentation\n' +
-          '======================\n'
-          + '\n\n' +
-          read('src', 'zc', 'resourcelibrary', 'README.txt')
-          + '\n\n' +
-          read('CHANGES.txt')
-          ),
-      keywords = "zope3 resource javascript css inclusion",
-      classifiers = [
-          'Development Status :: 5 - Production/Stable',
-          'Environment :: Web Environment',
-          'Intended Audience :: Developers',
-          'License :: OSI Approved :: Zope Public License',
-          'Programming Language :: Python',
-          'Natural Language :: English',
-          'Operating System :: OS Independent',
-          'Topic :: Internet :: WWW/HTTP',
-          'Framework :: Zope3'],
-      url='http://cheeseshop.python.org/pypi/zc.resourcelibrary',
-      license='ZPL 2.1',
-      packages=find_packages('src'),
-      package_dir = {'': 'src'},
-      namespace_packages=['zc'],
-      extras_require=dict(
-          test=['zope.app.authentication',
-                'zope.app.securitypolicy',
-                'zope.app.testing',
-                'zope.app.zcmlfiles',
-                'zope.pagetemplate',
-                'zope.securitypolicy',
-                'zope.testbrowser',
-                'zope.testing',
-                ]),
-      install_requires=['setuptools',
-                        'zope.app.component',
-                        'zope.app.publication',
-                        'zope.app.publisher',
-                        'zope.app.zapi',
-                        'zope.component',
-                        'zope.configuration',
-                        'zope.interface',
-                        'zope.publisher',
-                        'zope.security',
-                        'zope.tales',
-                        'zope.traversing',
-                        ],
-      include_package_data = True,
-      zip_safe = False,
-      )

Copied: zc.resourcelibrary/tags/1.0.2/setup.py (from rev 95099, zc.resourcelibrary/trunk/setup.py)
===================================================================
--- zc.resourcelibrary/tags/1.0.2/setup.py	                        (rev 0)
+++ zc.resourcelibrary/tags/1.0.2/setup.py	2009-01-27 10:02:04 UTC (rev 95103)
@@ -0,0 +1,79 @@
+##############################################################################
+#
+# Copyright (c) 2007 Zope Corporation 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.
+#
+##############################################################################
+"""Setup for zc.resourcelibrary package
+
+$Id: setup.py 81038 2007-10-24 14:34:17Z srichter $
+"""
+import os
+from setuptools import setup, find_packages
+
+def read(*rnames):
+    return open(os.path.join(os.path.dirname(__file__), *rnames)).read()
+
+setup(name='zc.resourcelibrary',
+      version = '1.0.2',
+      author='Zope Corporation and Contributors',
+      author_email='zope-dev at zope.org',
+      description='Post-rendering Resource Inclusion',
+      long_description=(
+          read('README.txt')
+          + '\n\n' +
+          'Detailed Dcoumentation\n' +
+          '======================\n'
+          + '\n\n' +
+          read('src', 'zc', 'resourcelibrary', 'README.txt')
+          + '\n\n' +
+          read('CHANGES.txt')
+          ),
+      keywords = "zope3 resource javascript css inclusion",
+      classifiers = [
+          'Development Status :: 5 - Production/Stable',
+          'Environment :: Web Environment',
+          'Intended Audience :: Developers',
+          'License :: OSI Approved :: Zope Public License',
+          'Programming Language :: Python',
+          'Natural Language :: English',
+          'Operating System :: OS Independent',
+          'Topic :: Internet :: WWW/HTTP',
+          'Framework :: Zope3'],
+      url='http://pypi.python.org/pypi/zc.resourcelibrary',
+      license='ZPL 2.1',
+      packages=find_packages('src'),
+      package_dir = {'': 'src'},
+      namespace_packages=['zc'],
+      extras_require=dict(
+          test=['zope.app.authentication',
+                'zope.app.securitypolicy',
+                'zope.app.testing',
+                'zope.app.zcmlfiles',
+                'zope.pagetemplate',
+                'zope.securitypolicy',
+                'zope.testbrowser',
+                'zope.testing',
+                ]),
+      install_requires=['setuptools',
+                        'zope.app.component',
+                        'zope.app.publication',
+                        'zope.app.publisher',
+                        'zope.component',
+                        'zope.configuration',
+                        'zope.interface',
+                        'zope.publisher',
+                        'zope.security',
+                        'zope.tales',
+                        'zope.traversing',
+                        ],
+      include_package_data = True,
+      zip_safe = False,
+      )

Deleted: zc.resourcelibrary/tags/1.0.2/src/zc/resourcelibrary/zcml.py
===================================================================
--- zc.resourcelibrary/trunk/src/zc/resourcelibrary/zcml.py	2009-01-27 09:44:48 UTC (rev 95096)
+++ zc.resourcelibrary/tags/1.0.2/src/zc/resourcelibrary/zcml.py	2009-01-27 10:02:04 UTC (rev 95103)
@@ -1,125 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2006 Zope Corporation 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.
-#
-##############################################################################
-from zc.resourcelibrary.resourcelibrary import LibraryInfo, library_info
-from zope.app import zapi
-from zope.app.publisher.browser import directoryresource
-from zope.app.publisher.browser.metadirectives import IBasicResourceInformation
-from zope.app.publisher.browser.resourcemeta import allowed_names
-from zope.configuration.exceptions import ConfigurationError
-from zope.interface import Interface
-from zope.publisher.interfaces.browser import IBrowserRequest
-from zope.publisher.interfaces.browser import IDefaultBrowserLayer
-from zope.security.checker import CheckerPublic, NamesChecker
-import os.path
-import zope.configuration.fields
-
-class IResourceLibraryDirective(IBasicResourceInformation):
-    """
-    Defines a resource library
-    """
-
-    name = zope.schema.TextLine(
-        title=u"The name of the resource library",
-        description=u"""\
-        This is the name used to disambiguate resource libraries.  No two
-        libraries can be active with the same name.""",
-        required=True,
-        )
-
-    require = zope.configuration.fields.Tokens(
-        title=u"Require",
-        description=u"The resource libraries on which this library depends.",
-        required=False,
-        value_type=zope.schema.Text(),
-        )
-
-
-class IDirectoryDirective(Interface):
-    """
-    Identifies a directory to be included in a resource library
-    """
-
-    source = zope.configuration.fields.Path(
-        title=u"Source",
-        description=u"The directory containing the files to add.",
-        required=True,
-        )
-
-    include = zope.configuration.fields.Tokens(
-        title=u"Include",
-        description=u"The files which should be included in HTML pages which "
-                    u"reference this resource library.",
-        required=False,
-        value_type=zope.schema.Text(),
-        )
-
-    factory = zope.configuration.fields.GlobalObject(
-        title=u"Factory",
-        description=u"Alternate directory-resource factory",
-        required=False,
-        )
-
-def handler(name, dependencies, required, provided, adapter_name, factory, info=''):
-    if dependencies:
-        for dep in dependencies:
-            if dep not in library_info:
-                raise ConfigurationError(
-                    'Resource library "%s" has unsatisfied dependency on "%s".'
-                    % (name, dep))
-    zapi.getGlobalSiteManager().registerAdapter(
-        factory, required, provided, adapter_name, info)
-
-
-INCLUDABLE_EXTENTIONS = ('.js', '.css', '.kss')
-
-class ResourceLibrary(object):
-
-    def __init__(self, _context, name, require=(),
-                 layer=IDefaultBrowserLayer, permission='zope.Public'):
-        self.name =  name
-        self.layer = layer
-
-        if permission == 'zope.Public':
-            permission = CheckerPublic
-        self.checker = NamesChecker(allowed_names, permission)
-
-        # make note of the library in a global registry
-        library_info[name] = LibraryInfo()
-        library_info[name].required.extend(require)
-
-    def directory(self, _context, source, include=(), factory=None):
-        if not os.path.isdir(source):
-            raise ConfigurationError("Directory %r does not exist" % source)
-
-        for file_name in include:
-            ext = os.path.splitext(file_name)[1]
-            if ext not in INCLUDABLE_EXTENTIONS:
-                raise ConfigurationError(
-                    'Resource library doesn\'t know how to include this '
-                    'file: "%s".' % file_name)
-
-        # remember which files should be included in the HTML when this library
-        # is referenced
-        library_info[self.name].included.extend(include)
-
-        if factory is None:
-            factory = directoryresource.DirectoryResourceFactory
-        factory = factory(source, self.checker, self.name)
-
-        _context.action(
-            discriminator = ('resource', self.name, IBrowserRequest, self.layer),
-            callable = handler,
-            args = (self.name, library_info[self.name].required, (self.layer,),
-                    Interface, self.name, factory, _context.info),
-            )

Copied: zc.resourcelibrary/tags/1.0.2/src/zc/resourcelibrary/zcml.py (from rev 95099, zc.resourcelibrary/trunk/src/zc/resourcelibrary/zcml.py)
===================================================================
--- zc.resourcelibrary/tags/1.0.2/src/zc/resourcelibrary/zcml.py	                        (rev 0)
+++ zc.resourcelibrary/tags/1.0.2/src/zc/resourcelibrary/zcml.py	2009-01-27 10:02:04 UTC (rev 95103)
@@ -0,0 +1,125 @@
+##############################################################################
+#
+# Copyright (c) 2006 Zope Corporation 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.
+#
+##############################################################################
+from zc.resourcelibrary.resourcelibrary import LibraryInfo, library_info
+from zope.app.publisher.browser import directoryresource
+from zope.app.publisher.browser.metadirectives import IBasicResourceInformation
+from zope.app.publisher.browser.resourcemeta import allowed_names
+from zope.configuration.exceptions import ConfigurationError
+from zope.component import getGlobalSiteManager
+from zope.interface import Interface
+from zope.publisher.interfaces.browser import IBrowserRequest
+from zope.publisher.interfaces.browser import IDefaultBrowserLayer
+from zope.security.checker import CheckerPublic, NamesChecker
+import os.path
+import zope.configuration.fields
+
+class IResourceLibraryDirective(IBasicResourceInformation):
+    """
+    Defines a resource library
+    """
+
+    name = zope.schema.TextLine(
+        title=u"The name of the resource library",
+        description=u"""\
+        This is the name used to disambiguate resource libraries.  No two
+        libraries can be active with the same name.""",
+        required=True,
+        )
+
+    require = zope.configuration.fields.Tokens(
+        title=u"Require",
+        description=u"The resource libraries on which this library depends.",
+        required=False,
+        value_type=zope.schema.Text(),
+        )
+
+
+class IDirectoryDirective(Interface):
+    """
+    Identifies a directory to be included in a resource library
+    """
+
+    source = zope.configuration.fields.Path(
+        title=u"Source",
+        description=u"The directory containing the files to add.",
+        required=True,
+        )
+
+    include = zope.configuration.fields.Tokens(
+        title=u"Include",
+        description=u"The files which should be included in HTML pages which "
+                    u"reference this resource library.",
+        required=False,
+        value_type=zope.schema.Text(),
+        )
+
+    factory = zope.configuration.fields.GlobalObject(
+        title=u"Factory",
+        description=u"Alternate directory-resource factory",
+        required=False,
+        )
+
+def handler(name, dependencies, required, provided, adapter_name, factory, info=''):
+    if dependencies:
+        for dep in dependencies:
+            if dep not in library_info:
+                raise ConfigurationError(
+                    'Resource library "%s" has unsatisfied dependency on "%s".'
+                    % (name, dep))
+    getGlobalSiteManager().registerAdapter(
+        factory, required, provided, adapter_name, info)
+
+
+INCLUDABLE_EXTENTIONS = ('.js', '.css', '.kss')
+
+class ResourceLibrary(object):
+
+    def __init__(self, _context, name, require=(),
+                 layer=IDefaultBrowserLayer, permission='zope.Public'):
+        self.name =  name
+        self.layer = layer
+
+        if permission == 'zope.Public':
+            permission = CheckerPublic
+        self.checker = NamesChecker(allowed_names, permission)
+
+        # make note of the library in a global registry
+        library_info[name] = LibraryInfo()
+        library_info[name].required.extend(require)
+
+    def directory(self, _context, source, include=(), factory=None):
+        if not os.path.isdir(source):
+            raise ConfigurationError("Directory %r does not exist" % source)
+
+        for file_name in include:
+            ext = os.path.splitext(file_name)[1]
+            if ext not in INCLUDABLE_EXTENTIONS:
+                raise ConfigurationError(
+                    'Resource library doesn\'t know how to include this '
+                    'file: "%s".' % file_name)
+
+        # remember which files should be included in the HTML when this library
+        # is referenced
+        library_info[self.name].included.extend(include)
+
+        if factory is None:
+            factory = directoryresource.DirectoryResourceFactory
+        factory = factory(source, self.checker, self.name)
+
+        _context.action(
+            discriminator = ('resource', self.name, IBrowserRequest, self.layer),
+            callable = handler,
+            args = (self.name, library_info[self.name].required, (self.layer,),
+                    Interface, self.name, factory, _context.info),
+            )



More information about the Checkins mailing list