fix remaining 'implements'...

This commit is contained in:
Helmut Merz 2025-02-22 11:31:19 +01:00
parent fe632fbeab
commit 0e5270f8d5
9 changed files with 24 additions and 107 deletions

View file

@ -6,7 +6,6 @@
from urlparse import urlparse
from zope.container.traversal import ItemTraverser
from zope.interface import Interface, implements
class TraversalRedirector(ItemTraverser):

View file

@ -1,30 +1,10 @@
#
# Copyright (c) 2008 Helmut Merz helmutm@cy55.de
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# cybertools.pyscript.plog
"""
Management of filesystem images (plots) and corresponding views.
$Id$
""" Management of filesystem images (plots) and corresponding views.
"""
import os
import time
from zope.interface import Interface, implements
from zope.cachedescriptors.property import Lazy
from cybertools.util import randomname, jeep

View file

@ -1,13 +1,10 @@
"""Tests for pyscript
# cybertools.pyscript.tests
Based on Zope Python Page.
$Id$
"""
#Based on Zope Python Page.
import unittest, doctest
from zope import component
from zope.interface import implements
from zope.interface import implementer
from zope.location.traversing import LocationPhysicallyLocatable
from zope.traversing.interfaces import IContainmentRoot
from zope.traversing.interfaces import IPhysicallyLocatable
@ -17,8 +14,8 @@ from zope.app.testing import placelesssetup
from cybertools.pyscript.script import ScriptContainer, HAS_R
@implementer(IContainmentRoot)
class Root(ScriptContainer, Contained):
implements(IContainmentRoot)
__parent__ = None
__name__ = 'root'

View file

@ -1,28 +1,8 @@
#
# Copyright (c) 2009 Helmut Merz helmutm@cy55.de
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# cybertools.roa.json
"""
Adapter(s)/view(s) for providing object attributes and other data in JSON format.
$Id$
""" Adapter(s)/view(s) for providing object attributes and other data in JSON format.
"""
from zope.interface import implements
from cybertools.util import json

View file

@ -1,33 +1,15 @@
#
# Copyright (c) 2008 Helmut Merz helmutm@cy55.de
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# cybertools.tracking.comment.base
"""
Basic implementation of comments / discussions.
$Id$
""" Basic implementation of comments / discussions.
"""
from zope.interface import implements
from zope.interface import implementer
from cybertools.tracking.btree import Track
from cybertools.tracking.comment.interfaces import IComment
@implementer(IComment)
class Comment(Track):
implements(IComment)
pass

View file

@ -1,32 +1,13 @@
#
# Copyright (c) 2010 Helmut Merz helmutm@cy55.de
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# cybertools.z2.generic
"""
Base classes.
$Id$
""" Base classes.
"""
from Acquisition import aq_inner, aq_parent
from persistent.mapping import PersistentMapping
from zope.app.container.interfaces import IObjectAddedEvent
from zope import component
from zope.interface import implements
from zope.interface import implementer
from cybertools.util.generic.interfaces import IGeneric
from cybertools.util.generic.interfaces import IGenericObject, IGenericFolder
@ -35,14 +16,13 @@ from cybertools.util.generic.interfaces import IGenericObject, IGenericFolder
_not_found = object()
@implementer(IGenericObject)
class GenericObject(object):
""" A mixin class supporting generic attribute access and other
basic or common functionality when combined with Zope2's
SimpleItem.
"""
implements(IGenericObject)
typeInterface = None
def setup(self):
@ -68,13 +48,12 @@ class GenericObject(object):
self.getParent().manage_renameObject(self.name, newName)
@implementer(IGenericFolder)
class GenericFolder(GenericObject):
""" Provide generic (i.e. dictionary-like) folder access to Zope2's
Folder or BTreeFolder.
"""
implements(IGenericFolder)
def __getitem__(self, name):
return getattr(self, name)

View file

@ -8,13 +8,13 @@ from zope.app.intid.interfaces import IntIdAddedEvent, IntIdRemovedEvent
from zope.app.container.interfaces import IObjectAddedEvent, IObjectRemovedEvent
from zope.app.keyreference.interfaces import IKeyReference, NotYet
from zope.event import notify
from zope.interface import implements
from zope.interface import implementer
_marker = []
@implementer(IIntIds)
class IntIds(z3IntIds):
""" zope2ish intid utility """
implements(IIntIds)
meta_type="IntId Utility"

View file

@ -5,7 +5,7 @@ from zExceptions import NotFound
from persistent import IPersistent
from zope.component import adapter, adapts
from zope.app.component.hooks import getSite
from zope.interface import implements, implementer
from zope.interface import implementer
from zope.app.keyreference.interfaces import IKeyReference, NotYet
from zope.app.keyreference.persistent import KeyReferenceToPersistent
from site import get_root, aq_iter
@ -30,6 +30,7 @@ def add_object_to_connection(ob, event):
connection.add(aq_base(ob))
@implementer(IKeyReference)
class KeyReferenceToPersistent(KeyReferenceToPersistent):
"""a zope2ish implementation of keyreferences that unwraps objects
that have Acquisition wrappers
@ -38,7 +39,6 @@ class KeyReferenceToPersistent(KeyReferenceToPersistent):
@@ cache IConnection as a property and volative attr?
"""
implements(IKeyReference)
adapts(IPersistent)
key_type_id = 'five.intid.keyreference'

View file

@ -1,7 +1,7 @@
# Sometimes persistent classes are never meant to be persisted. The most
# common example are CMFCore directory views and filesystem objects.
# Register specific handlers that are no-ops to circumvent
from zope.interface import implements
from zope.interface import implementer
from zope.app.keyreference.interfaces import IKeyReference, NotYet
def addIntIdSubscriber(ob, event):
@ -13,9 +13,9 @@ def removeIntIdSubscriber(ob, event):
def moveIntIdSubscriber(ob, event):
return
@implementer(IKeyReference)
class KeyReferenceNever(object):
"""A keyreference that is never ready"""
implements(IKeyReference)
key_type_id = 'five.intid.cmfexceptions.keyreference'