diff --git a/cybertools/browser/url.py b/cybertools/browser/url.py index e87f523..22709ac 100644 --- a/cybertools/browser/url.py +++ b/cybertools/browser/url.py @@ -6,7 +6,6 @@ from urlparse import urlparse from zope.container.traversal import ItemTraverser -from zope.interface import Interface, implements class TraversalRedirector(ItemTraverser): diff --git a/cybertools/pyscript/plot.py b/cybertools/pyscript/plot.py index e5a5e44..429f995 100644 --- a/cybertools/pyscript/plot.py +++ b/cybertools/pyscript/plot.py @@ -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 diff --git a/cybertools/pyscript/tests.py b/cybertools/pyscript/tests.py index 75ff377..a4e72d8 100644 --- a/cybertools/pyscript/tests.py +++ b/cybertools/pyscript/tests.py @@ -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' diff --git a/cybertools/roa/json.py b/cybertools/roa/json.py index bf2544c..34800d5 100644 --- a/cybertools/roa/json.py +++ b/cybertools/roa/json.py @@ -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 diff --git a/cybertools/tracking/comment/base.py b/cybertools/tracking/comment/base.py index 9318e7f..7990924 100644 --- a/cybertools/tracking/comment/base.py +++ b/cybertools/tracking/comment/base.py @@ -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 diff --git a/cybertools/z2/generic.py b/cybertools/z2/generic.py index a1efea9..a65f6c1 100644 --- a/cybertools/z2/generic.py +++ b/cybertools/z2/generic.py @@ -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) diff --git a/cybertools/z2/intid/intid.py b/cybertools/z2/intid/intid.py index b28c608..ff95681 100644 --- a/cybertools/z2/intid/intid.py +++ b/cybertools/z2/intid/intid.py @@ -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" diff --git a/cybertools/z2/intid/keyreference.py b/cybertools/z2/intid/keyreference.py index d23989c..3c776f6 100644 --- a/cybertools/z2/intid/keyreference.py +++ b/cybertools/z2/intid/keyreference.py @@ -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' diff --git a/cybertools/z2/intid/unreferenceable.py b/cybertools/z2/intid/unreferenceable.py index e6aa260..7136016 100644 --- a/cybertools/z2/intid/unreferenceable.py +++ b/cybertools/z2/intid/unreferenceable.py @@ -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'