[Zope3-checkins] SVN: Zope3/branches/zipimport-support/src/zope/ rename zope.resource --> zope.filereference

Fred L. Drake, Jr. fdrake at gmail.com
Wed Nov 9 14:38:37 EST 2005


Log message for revision 40004:
  rename zope.resource --> zope.filereference

Changed:
  U   Zope3/branches/zipimport-support/src/zope/configuration/config.py
  A   Zope3/branches/zipimport-support/src/zope/configuration/tests/filereference.txt
  D   Zope3/branches/zipimport-support/src/zope/configuration/tests/resources.txt
  U   Zope3/branches/zipimport-support/src/zope/configuration/tests/test_config.py
  U   Zope3/branches/zipimport-support/src/zope/configuration/xmlconfig.py
  A   Zope3/branches/zipimport-support/src/zope/filereference/
  A   Zope3/branches/zipimport-support/src/zope/filereference/DEPENDENCIES.cfg
  U   Zope3/branches/zipimport-support/src/zope/filereference/README.txt
  D   Zope3/branches/zipimport-support/src/zope/filereference/__init__.py
  A   Zope3/branches/zipimport-support/src/zope/filereference/__init__.py
  D   Zope3/branches/zipimport-support/src/zope/filereference/reference.py
  A   Zope3/branches/zipimport-support/src/zope/filereference/reference.py
  U   Zope3/branches/zipimport-support/src/zope/filereference/tests.py
  D   Zope3/branches/zipimport-support/src/zope/resource/

-=-
Modified: Zope3/branches/zipimport-support/src/zope/configuration/config.py
===================================================================
--- Zope3/branches/zipimport-support/src/zope/configuration/config.py	2005-11-09 19:22:11 UTC (rev 40003)
+++ Zope3/branches/zipimport-support/src/zope/configuration/config.py	2005-11-09 19:38:37 UTC (rev 40004)
@@ -26,7 +26,7 @@
 
 from keyword import iskeyword
 import zope.deprecation
-import zope.resource
+import zope.filereference
 from zope.configuration.exceptions import ConfigurationError
 from zope.configuration.interfaces import IConfigurationContext
 from zope.configuration.interfaces import IGroupingContext
@@ -250,7 +250,7 @@
             package = getattr(self, 'package', None)
         else:
             package = self.package
-        return zope.resource.new(filename, package, basepath)
+        return zope.filereference.new(filename, package, basepath)
 
     def checkDuplicate(self, filename):
         """Check for duplicate imports of the same file.

Copied: Zope3/branches/zipimport-support/src/zope/configuration/tests/filereference.txt (from rev 40001, Zope3/branches/zipimport-support/src/zope/configuration/tests/resources.txt)
===================================================================
--- Zope3/branches/zipimport-support/src/zope/configuration/tests/resources.txt	2005-11-09 18:00:29 UTC (rev 40001)
+++ Zope3/branches/zipimport-support/src/zope/configuration/tests/filereference.txt	2005-11-09 19:38:37 UTC (rev 40004)
@@ -0,0 +1,67 @@
+=======================
+File references in ZCML
+=======================
+
+The ZCML loading machinery uses the `zope.filereference` facilities to
+deal with references to files that should be loaded.  This allows
+including ZCML files from ZIP archives using <include/> directives,
+and allows ZCML directives that have Path schema attributes as
+arguments to use the `zope.filereference` facilities as well.
+
+We'll use the sample ZIP archive provided for the `zope.filereference`
+tests::
+
+  >>> import os
+  >>> import sys
+  >>> import zope.filereference
+
+  >>> directory = os.path.dirname(zope.filereference.__file__)
+  >>> zipfile = os.path.join(directory, "zippitysample.zip")
+  >>> sys.path.append(zipfile)
+
+Our example ZIP file includes an example ZCML file; let's see how we
+can load it using <include/>::
+
+  >>> from StringIO import StringIO
+  >>> from zope.configuration import config, xmlconfig
+
+  >>> def zcml(text):
+  ...     context = config.ConfigurationMachine()
+  ...     xmlconfig.registerCommonDirectives(context)
+  ...     f = StringIO(text)
+  ...     xmlconfig.processxmlfile(f, context, testing=True)
+  ...     f.close()
+  ...     return context
+
+  >>> context = zcml('<include package="zippity.sample"/>')
+
+We can now check that the "feature" provided by our sample
+configuration has been defined::
+
+  >>> context.hasFeature("sample")
+  True
+
+We can also include one ZCML file from another in the ZIP archive.
+Loading an alternate configuration file that includes the first should
+cause the "sample" feature to be provided::
+
+  >>> context = zcml(
+  ...     '<include package="zippity.sample" file="including.zcml"/>')
+
+  >>> context.hasFeature("sample")
+  True
+
+One oddball feature of the ZCML machinery is that if a ZCML file being
+loaded doesn't exist, but a file of the same name with '.in' appended
+does, that will be loaded instead.  In this example, the sample
+package provides a 'silliness.zcml.in', but we're going to request
+'silliness.zcml'::
+
+  >>> context = config.ConfigurationMachine()
+  >>> xmlconfig.registerCommonDirectives(context)
+
+  >>> context = zcml(
+  ...     '<include package="zippity.sample" file="silliness.zcml"/>')
+
+  >>> context.hasFeature("silliness")
+  True

Deleted: Zope3/branches/zipimport-support/src/zope/configuration/tests/resources.txt
===================================================================
--- Zope3/branches/zipimport-support/src/zope/configuration/tests/resources.txt	2005-11-09 19:22:11 UTC (rev 40003)
+++ Zope3/branches/zipimport-support/src/zope/configuration/tests/resources.txt	2005-11-09 19:38:37 UTC (rev 40004)
@@ -1,67 +0,0 @@
-===========================
-Resource references in ZCML
-===========================
-
-The ZCML loading machinery uses the `zope.resource` facilities to deal
-with references to files that should be loaded.  This allows including
-ZCML files from ZIP archives using <include/> directives, and allows
-ZCML directives that have Path schema attributes as arguments to use
-the `zope.resource` facilities as well.
-
-We'll use the sample ZIP archive provided for the `zope.resource`
-tests::
-
-  >>> import os
-  >>> import sys
-  >>> import zope.resource
-
-  >>> directory = os.path.dirname(zope.resource.__file__)
-  >>> zipfile = os.path.join(directory, "zippitysample.zip")
-  >>> sys.path.append(zipfile)
-
-Our example ZIP file includes an example ZCML file; let's see how we
-can load it using <include/>::
-
-  >>> from StringIO import StringIO
-  >>> from zope.configuration import config, xmlconfig
-
-  >>> def zcml(text):
-  ...     context = config.ConfigurationMachine()
-  ...     xmlconfig.registerCommonDirectives(context)
-  ...     f = StringIO(text)
-  ...     xmlconfig.processxmlfile(f, context, testing=True)
-  ...     f.close()
-  ...     return context
-
-  >>> context = zcml('<include package="zippity.sample"/>')
-
-We can now check that the "feature" provided by our sample
-configuration has been defined::
-
-  >>> context.hasFeature("sample")
-  True
-
-We can also include one ZCML file from another in the ZIP archive.
-Loading an alternate configuration file that includes the first should
-cause the "sample" feature to be provided::
-
-  >>> context = zcml(
-  ...     '<include package="zippity.sample" file="including.zcml"/>')
-
-  >>> context.hasFeature("sample")
-  True
-
-One oddball feature of the ZCML machinery is that if a ZCML file being
-loaded doesn't exist, but a file of the same name with '.in' appended
-does, that will be loaded instead.  In this example, the sample
-package provides a 'silliness.zcml.in', but we're going to request
-'silliness.zcml'::
-
-  >>> context = config.ConfigurationMachine()
-  >>> xmlconfig.registerCommonDirectives(context)
-
-  >>> context = zcml(
-  ...     '<include package="zippity.sample" file="silliness.zcml"/>')
-
-  >>> context.hasFeature("silliness")
-  True

Modified: Zope3/branches/zipimport-support/src/zope/configuration/tests/test_config.py
===================================================================
--- Zope3/branches/zipimport-support/src/zope/configuration/tests/test_config.py	2005-11-09 19:22:11 UTC (rev 40003)
+++ Zope3/branches/zipimport-support/src/zope/configuration/tests/test_config.py	2005-11-09 19:38:37 UTC (rev 40004)
@@ -276,7 +276,7 @@
 
 def test_suite():
     return unittest.TestSuite((
-        DocFileSuite('resources.txt',
+        DocFileSuite('filereference.txt',
                      setUp=sys_path_setUp, tearDown=sys_path_tearDown),
         DocTestSuite('zope.configuration.fields'),
         DocTestSuite('zope.configuration.config'),

Modified: Zope3/branches/zipimport-support/src/zope/configuration/xmlconfig.py
===================================================================
--- Zope3/branches/zipimport-support/src/zope/configuration/xmlconfig.py	2005-11-09 19:22:11 UTC (rev 40003)
+++ Zope3/branches/zipimport-support/src/zope/configuration/xmlconfig.py	2005-11-09 19:38:37 UTC (rev 40004)
@@ -26,7 +26,7 @@
 import sys
 import logging
 import zope.configuration.config as config
-import zope.resource
+import zope.filereference
 
 from glob import glob
 from xml.sax import make_parser
@@ -392,12 +392,12 @@
 
     """
     try:
-        fp = zope.resource.open(filename)
+        fp = zope.filereference.open(filename)
     except IOError, e:
         if e.errno == errno.ENOENT:
             fn = filename + ".in"
             try:
-                fp = zope.resource.open(fn)
+                fp = zope.filereference.open(fn)
             except IOError:
                 raise e
         else:

Copied: Zope3/branches/zipimport-support/src/zope/filereference (from rev 40001, Zope3/branches/zipimport-support/src/zope/resource)

Copied: Zope3/branches/zipimport-support/src/zope/filereference/DEPENDENCIES.cfg (from rev 40003, Zope3/branches/zipimport-support/src/zope/resource/DEPENDENCIES.cfg)

Modified: Zope3/branches/zipimport-support/src/zope/filereference/README.txt
===================================================================
--- Zope3/branches/zipimport-support/src/zope/resource/README.txt	2005-11-09 18:00:29 UTC (rev 40001)
+++ Zope3/branches/zipimport-support/src/zope/filereference/README.txt	2005-11-09 19:38:37 UTC (rev 40004)
@@ -2,12 +2,12 @@
 Package-relative resource references
 ====================================
 
-The `zope.configuration.path` module provides a way to refer to and
-open a file using a package-relative path.  This is especially useful
-for packages imported from ZIP files (including eggs).  Such files are
-considered resources, and may only be opened in read-only mode.
+The `zope.filereference` package provides a way to refer to and open a
+file using a package-relative path.  This is especially useful for
+packages imported from ZIP files (including eggs).  Such files may
+only be opened in read-only mode.
 
-Resource references have a dual personality:  They are both strings
+File references have a dual personality:  They are both strings
 and objects with interesting non-string methods.  The string behavior
 is intended to help support compatibility for code that was written
 before this API existed, while new code can use the extended API for
@@ -28,27 +28,27 @@
 provides::
 
   >>> import os
-  >>> import zope.resource
+  >>> import zope.filereference
 
-  >>> ref = zope.resource.new("README.txt", package=zope.resource)
+  >>> ref = zope.filereference.new("README.txt", package=zope.filereference)
 
 If we examine the reference as a string, we get a path that points
 into the package::
 
-  >>> directory = os.path.dirname(zope.resource.__file__)
+  >>> directory = os.path.dirname(zope.filereference.__file__)
   >>> ref == os.path.join(directory, "README.txt")
   True
 
-The resource can be opened using the `open()` function (which
+The reference can be opened using the `open()` function (which
 also accepts simple strings)::
 
-  >>> f = zope.resource.open(ref)
+  >>> f = zope.filereference.open(ref)
   >>> f.readline()
   '====================================\n'
   >>> f.close()
 
 While this looks little different from using a simple string to refer
-to the resource file, it provides more functionality if the resource
+to the referenced file, it provides more functionality if the file
 being referenced is part of a package contained in a ZIP archive.
 Let's add a convenient ZIP file containing a Python package to the
 module search path::
@@ -63,31 +63,31 @@
 resources from it::
 
   >>> import zippity.sample
-  >>> ref = zope.resource.new("configure.zcml", package=zippity.sample)
+  >>> ref = zope.filereference.new("configure.zcml", package=zippity.sample)
 
-  >>> f = zope.resource.open(ref)
+  >>> f = zope.filereference.open(ref)
   >>> f.readline()
   '<configure\n'
   >>> f.close()
 
 Note that only read modes are supported::
 
-  >>> zope.resource.open(ref, "w")
+  >>> zope.filereference.open(ref, "w")
   Traceback (most recent call last):
     ...
   ValueError: `mode` must be a read-only mode
 
-  >>> zope.resource.open(ref, "w+")
+  >>> zope.filereference.open(ref, "w+")
   Traceback (most recent call last):
     ...
   ValueError: `mode` must be a read-only mode
 
-  >>> zope.resource.open(ref, "a")
+  >>> zope.filereference.open(ref, "a")
   Traceback (most recent call last):
     ...
   ValueError: `mode` must be a read-only mode
 
-  >>> zope.resource.open(ref, "a+")
+  >>> zope.filereference.open(ref, "a+")
   Traceback (most recent call last):
     ...
   ValueError: `mode` must be a read-only mode

Deleted: Zope3/branches/zipimport-support/src/zope/filereference/__init__.py
===================================================================
--- Zope3/branches/zipimport-support/src/zope/resource/__init__.py	2005-11-09 18:00:29 UTC (rev 40001)
+++ Zope3/branches/zipimport-support/src/zope/filereference/__init__.py	2005-11-09 19:38:37 UTC (rev 40004)
@@ -1,21 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2005 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.
-#
-##############################################################################
-"""Resource references.
-
-"""
-__docformat__ = "reStructuredText"
-
-
-from reference import newReference as new
-from reference import openResource as open

Copied: Zope3/branches/zipimport-support/src/zope/filereference/__init__.py (from rev 40003, Zope3/branches/zipimport-support/src/zope/resource/__init__.py)
===================================================================
--- Zope3/branches/zipimport-support/src/zope/resource/__init__.py	2005-11-09 19:22:11 UTC (rev 40003)
+++ Zope3/branches/zipimport-support/src/zope/filereference/__init__.py	2005-11-09 19:38:37 UTC (rev 40004)
@@ -0,0 +1,22 @@
+##############################################################################
+#
+# Copyright (c) 2005 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.
+#
+##############################################################################
+"""References to file-like things, including files inside zipped packages.
+
+This supports referencing files within Python eggs.
+
+"""
+__docformat__ = "reStructuredText"
+
+
+from reference import open, new

Deleted: Zope3/branches/zipimport-support/src/zope/filereference/reference.py
===================================================================
--- Zope3/branches/zipimport-support/src/zope/resource/reference.py	2005-11-09 18:00:29 UTC (rev 40001)
+++ Zope3/branches/zipimport-support/src/zope/filereference/reference.py	2005-11-09 19:38:37 UTC (rev 40004)
@@ -1,140 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2001, 2002, 2003 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.
-#
-##############################################################################
-"""References to package-relative resources.
-
-"""
-__docformat__ = "reStructuredText"
-
-import errno
-import os
-import StringIO
-
-import zope.interface
-
-from zope.resource.interfaces import IResourceReference
-
-try:
-    import pkg_resources
-except ImportError:
-    pkg_resources = None
-
-
-def openResource(path, mode="rb"):
-    if not mode.startswith("r"):
-        raise ValueError("`mode` must be a read-only mode")
-    if IResourceReference.providedBy(path):
-        return path.open(mode)
-    else:
-        return open(path, mode)
-
-
-def newReference(path, package=None, basepath=None):
-
-    if os.path.isabs(path):
-        return PathReference(path)
-
-    # Got a relative path, combine with base path.
-    # If we have no basepath, compute the base path from the package
-    # path.
-
-    if not basepath:
-        if package is None:
-            basepath = os.getcwd()
-        else:
-            basepath = os.path.dirname(package.__file__)
-
-    p = os.path.join(basepath, path)
-    p = os.path.normpath(p)
-    p = os.path.abspath(p)
-
-    if package:
-        return PackagePathReference(p, package, path)
-    else:
-        return PathReference(p)
-
-
-class PathReference(str):
-
-    zope.interface.implements(IResourceReference)
-
-    def __add__(self, other):
-        path = str(self) + other
-        return self.__class__(path)
-
-    def open(self, mode="rb"):
-        return open(self, mode)
-
-
-class PackagePathReference(str):
-
-    zope.interface.implements(IResourceReference)
-
-    def __new__(cls, value, package, relpath):
-        assert package
-        self = str.__new__(cls, value)
-        self._package = package
-        self._relpath = relpath
-        return self
-
-    def __add__(self, other):
-        value = str(self) + other
-        relpath = self._relpath + other
-        return self.__class__(value, self._package, relpath)
-
-    def open_pkg_resources(self, mode="rb"):
-        return self._open_packaged_resource(
-            mode,
-            pkg_resources.resource_string,
-            self._package.__name__,
-            self._relpath)
-
-    def open_path_or_loader(self, mode="rb"):
-        try:
-            loader = self._package.__loader__
-        except AttributeError:
-            for dir in self._package.__path__:
-                filename = os.path.join(dir, self._relpath)
-                if os.path.exists(filename):
-                    break
-            return open(filename, mode)
-        else:
-            dir = os.path.dirname(self._package.__file__)
-            filename = os.path.join(dir, self._relpath)
-            return self._open_packaged_resource(
-                mode, loader.get_data, filename)
-
-    def open(self, mode="rb"):
-        #
-        # This separate wrapper method is used so that this can always
-        # be tested for the case when pkg_resources is not available.
-        # See tests.py for how the pkg_resources global is
-        # manipulated.
-        #
-        if pkg_resources:
-            return self.open_pkg_resources(mode)
-        else:
-            return self.open_path_or_loader(mode)
-
-    def _open_packaged_resource(self, mode, opener, *args):
-        try:
-            data = opener(*args)
-        except IOError, e:
-            if len(e.args) == 1:
-                raise IOError(errno.ENOENT, "file not found", self)
-            else:
-                raise
-        f = StringIO.StringIO(data)
-        f.name = self
-        f.mode = mode
-        return f

Copied: Zope3/branches/zipimport-support/src/zope/filereference/reference.py (from rev 40003, Zope3/branches/zipimport-support/src/zope/resource/reference.py)
===================================================================
--- Zope3/branches/zipimport-support/src/zope/resource/reference.py	2005-11-09 19:22:11 UTC (rev 40003)
+++ Zope3/branches/zipimport-support/src/zope/filereference/reference.py	2005-11-09 19:38:37 UTC (rev 40004)
@@ -0,0 +1,141 @@
+##############################################################################
+#
+# Copyright (c) 2005 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.
+#
+##############################################################################
+"""References to package-relative resources.
+
+"""
+__docformat__ = "reStructuredText"
+
+import __builtin__
+import errno
+import os
+import StringIO
+
+import zope.interface
+
+from zope.filereference.interfaces import IResourceReference
+
+try:
+    import pkg_resources
+except ImportError:
+    pkg_resources = None
+
+
+def open(path, mode="rb"):
+    if not mode.startswith("r"):
+        raise ValueError("`mode` must be a read-only mode")
+    if IResourceReference.providedBy(path):
+        return path.open(mode)
+    else:
+        return __builtin__.open(path, mode)
+
+
+def new(path, package=None, basepath=None):
+
+    if os.path.isabs(path):
+        return PathReference(path)
+
+    # Got a relative path, combine with base path.
+    # If we have no basepath, compute the base path from the package
+    # path.
+
+    if not basepath:
+        if package is None:
+            basepath = os.getcwd()
+        else:
+            basepath = os.path.dirname(package.__file__)
+
+    p = os.path.join(basepath, path)
+    p = os.path.normpath(p)
+    p = os.path.abspath(p)
+
+    if package:
+        return PackagePathReference(p, package, path)
+    else:
+        return PathReference(p)
+
+
+class PathReference(str):
+
+    zope.interface.implements(IResourceReference)
+
+    def __add__(self, other):
+        path = str(self) + other
+        return self.__class__(path)
+
+    def open(self, mode="rb"):
+        return __builtin__.open(self, mode)
+
+
+class PackagePathReference(str):
+
+    zope.interface.implements(IResourceReference)
+
+    def __new__(cls, value, package, relpath):
+        assert package
+        self = str.__new__(cls, value)
+        self._package = package
+        self._relpath = relpath
+        return self
+
+    def __add__(self, other):
+        value = str(self) + other
+        relpath = self._relpath + other
+        return self.__class__(value, self._package, relpath)
+
+    def open_pkg_resources(self, mode="rb"):
+        return self._open_packaged_resource(
+            mode,
+            pkg_resources.resource_string,
+            self._package.__name__,
+            self._relpath)
+
+    def open_path_or_loader(self, mode="rb"):
+        try:
+            loader = self._package.__loader__
+        except AttributeError:
+            for dir in self._package.__path__:
+                filename = os.path.join(dir, self._relpath)
+                if os.path.exists(filename):
+                    break
+            return __builtin__.open(filename, mode)
+        else:
+            dir = os.path.dirname(self._package.__file__)
+            filename = os.path.join(dir, self._relpath)
+            return self._open_packaged_resource(
+                mode, loader.get_data, filename)
+
+    def open(self, mode="rb"):
+        #
+        # This separate wrapper method is used so that this can always
+        # be tested for the case when pkg_resources is not available.
+        # See tests.py for how the pkg_resources global is
+        # manipulated.
+        #
+        if pkg_resources:
+            return self.open_pkg_resources(mode)
+        else:
+            return self.open_path_or_loader(mode)
+
+    def _open_packaged_resource(self, mode, opener, *args):
+        try:
+            data = opener(*args)
+        except IOError, e:
+            if len(e.args) == 1:
+                raise IOError(errno.ENOENT, "file not found", self)
+            else:
+                raise
+        f = StringIO.StringIO(data)
+        f.name = self
+        f.mode = mode
+        return f

Modified: Zope3/branches/zipimport-support/src/zope/filereference/tests.py
===================================================================
--- Zope3/branches/zipimport-support/src/zope/resource/tests.py	2005-11-09 18:00:29 UTC (rev 40001)
+++ Zope3/branches/zipimport-support/src/zope/filereference/tests.py	2005-11-09 19:38:37 UTC (rev 40004)
@@ -11,7 +11,7 @@
 # FOR A PARTICULAR PURPOSE.
 #
 ##############################################################################
-"""Test resource machinery.
+"""Test filereference machinery.
 
 """
 __docformat__ = "reStructuredText"
@@ -19,7 +19,7 @@
 import sys
 import unittest
 
-import zope.resource.reference
+import zope.filereference.reference
 
 from zope.testing import doctest
 
@@ -37,17 +37,17 @@
 
 
 # If the pkg_resources module is available, this setUp/tearDown pair
-# can be used to hack zope.resource to think it isn't.  This is done
-# to ensure test coverage even when the module is present.
+# can be used to hack zope.filereference to think it isn't.  This is
+# done to ensure test coverage even when the module is present.
 
 def pkg_resources_setUp(self):
     sys_path_setUp(self)
     self.__old_pkg_resources = pkg_resources
-    zope.resource.reference.pkg_resources = None
+    zope.filereference.reference.pkg_resources = None
 
 def pkg_resources_tearDown(self):
     sys_path_tearDown(self)
-    zope.resource.pkg_resources = self.__old_pkg_resources
+    zope.filereference.pkg_resources = self.__old_pkg_resources
 
 
 def test_suite():



More information about the Zope3-Checkins mailing list