Skip to content

Commit

Permalink
Zope2 Interfaces package delenda est\!
Browse files Browse the repository at this point in the history
  • Loading branch information
tseaver committed Apr 28, 2008
1 parent a450638 commit dce6de9
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 48 deletions.
26 changes: 0 additions & 26 deletions IZCatalog.py

This file was deleted.

9 changes: 5 additions & 4 deletions ProgressHandler.py
Expand Up @@ -18,7 +18,8 @@
from logging import getLogger

from DateTime.DateTime import DateTime
from Interface import Interface
from zope.interface import Interface
from zope.interface import implements

LOG = getLogger('ProgressHandler')

Expand Down Expand Up @@ -54,7 +55,7 @@ def output(text):
class StdoutHandler:
""" A simple progress handler """

__implements__ = IProgressHandler
implements(IProgressHandler)

def __init__(self, steps=100):
self._steps = steps
Expand Down Expand Up @@ -89,7 +90,7 @@ def output(self, text):
class ZLogHandler(StdoutHandler):
""" Use Zope logger"""

__implements__ = IProgressHandler
implements(IProgressHandler)

def output(self, text):
LOG.info(text)
Expand All @@ -98,7 +99,7 @@ def output(self, text):
class FilelogHandler(StdoutHandler):
""" Use a custom file for logging """

__implements__ = IProgressHandler
implements(IProgressHandler)

def __init__(self, filename, steps=100):
StdoutHandler.__init__(self, steps)
Expand Down
12 changes: 4 additions & 8 deletions ZCatalog.py
Expand Up @@ -34,14 +34,11 @@
manage_zcatalog_entries, manage_zcatalog_indexes, search_zcatalog
from ZODB.POSException import ConflictError
import transaction
from Products.PluginIndexes.common.PluggableIndex \
import PluggableIndexInterface
from Products.PluginIndexes.interfaces import IPluggableIndex
from zope.interface import implements

from Catalog import Catalog, CatalogError
from interfaces import IZCatalog as z3IZCatalog
from IZCatalog import IZCatalog as z2IZCatalog
from interfaces import IZCatalog
from ProgressHandler import ZLogHandler
from ZCatalogIndexes import ZCatalogIndexes

Expand Down Expand Up @@ -82,8 +79,7 @@ class is that it is not Zope specific. You can use it in any
Python program to catalog objects.
"""

__implements__ = z2IZCatalog
implements(z3IZCatalog)
implements(IZCatalog)

security = ClassSecurityInfo()
security.setPermissionDefault(manage_zcatalog_entries, ('Manager',))
Expand Down Expand Up @@ -958,8 +954,8 @@ def addIndex(self, name, type,extra=None):
# Convert the type by finding an appropriate product which supports
# this interface by that name. Bleah

products = ObjectManager.all_meta_types(self, interfaces=(
PluggableIndexInterface, IPluggableIndex))
products = ObjectManager.all_meta_types(self,
interfaces=(IPluggableIndex,))

p = None

Expand Down
4 changes: 1 addition & 3 deletions ZCatalogIndexes.py
Expand Up @@ -23,8 +23,6 @@
from OFS.Folder import Folder
from OFS.ObjectManager import IFAwareObjectManager
from OFS.SimpleItem import SimpleItem
from Products.PluginIndexes.common.PluggableIndex \
import PluggableIndexInterface
from Products.PluginIndexes.interfaces import IPluggableIndex


Expand All @@ -37,7 +35,7 @@ class ZCatalogIndexes(IFAwareObjectManager, Folder, Persistent, Implicit):
the requested indexes in an object manager."""

# The interfaces we want to show up in our object manager
_product_interfaces = (PluggableIndexInterface, IPluggableIndex)
_product_interfaces = (IPluggableIndex,)

meta_type = "ZCatalogIndex"
manage_options = ()
Expand Down
7 changes: 0 additions & 7 deletions tests/testCatalog.py
Expand Up @@ -215,13 +215,6 @@ def setUp(self):
def _resolve_num(self, num):
return self.d[num]

def test_z2interfaces(self):
from Interface.Verify import verifyClass
from Products.ZCatalog.IZCatalog import IZCatalog
from Products.ZCatalog.ZCatalog import ZCatalog

verifyClass(IZCatalog, ZCatalog)

def test_z3interfaces(self):
from Products.ZCatalog.interfaces import IZCatalog
from Products.ZCatalog.ZCatalog import ZCatalog
Expand Down

0 comments on commit dce6de9

Please sign in to comment.