fix remaining 'implements'...
This commit is contained in:
parent
fe632fbeab
commit
0e5270f8d5
9 changed files with 24 additions and 107 deletions
|
@ -6,7 +6,6 @@
|
||||||
from urlparse import urlparse
|
from urlparse import urlparse
|
||||||
|
|
||||||
from zope.container.traversal import ItemTraverser
|
from zope.container.traversal import ItemTraverser
|
||||||
from zope.interface import Interface, implements
|
|
||||||
|
|
||||||
|
|
||||||
class TraversalRedirector(ItemTraverser):
|
class TraversalRedirector(ItemTraverser):
|
||||||
|
|
|
@ -1,30 +1,10 @@
|
||||||
#
|
# cybertools.pyscript.plog
|
||||||
# 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
|
|
||||||
#
|
|
||||||
|
|
||||||
"""
|
""" Management of filesystem images (plots) and corresponding views.
|
||||||
Management of filesystem images (plots) and corresponding views.
|
|
||||||
|
|
||||||
$Id$
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import time
|
import time
|
||||||
from zope.interface import Interface, implements
|
|
||||||
from zope.cachedescriptors.property import Lazy
|
from zope.cachedescriptors.property import Lazy
|
||||||
|
|
||||||
from cybertools.util import randomname, jeep
|
from cybertools.util import randomname, jeep
|
||||||
|
|
|
@ -1,13 +1,10 @@
|
||||||
"""Tests for pyscript
|
# cybertools.pyscript.tests
|
||||||
|
|
||||||
Based on Zope Python Page.
|
#Based on Zope Python Page.
|
||||||
|
|
||||||
$Id$
|
|
||||||
"""
|
|
||||||
|
|
||||||
import unittest, doctest
|
import unittest, doctest
|
||||||
from zope import component
|
from zope import component
|
||||||
from zope.interface import implements
|
from zope.interface import implementer
|
||||||
from zope.location.traversing import LocationPhysicallyLocatable
|
from zope.location.traversing import LocationPhysicallyLocatable
|
||||||
from zope.traversing.interfaces import IContainmentRoot
|
from zope.traversing.interfaces import IContainmentRoot
|
||||||
from zope.traversing.interfaces import IPhysicallyLocatable
|
from zope.traversing.interfaces import IPhysicallyLocatable
|
||||||
|
@ -17,8 +14,8 @@ from zope.app.testing import placelesssetup
|
||||||
from cybertools.pyscript.script import ScriptContainer, HAS_R
|
from cybertools.pyscript.script import ScriptContainer, HAS_R
|
||||||
|
|
||||||
|
|
||||||
|
@implementer(IContainmentRoot)
|
||||||
class Root(ScriptContainer, Contained):
|
class Root(ScriptContainer, Contained):
|
||||||
implements(IContainmentRoot)
|
|
||||||
|
|
||||||
__parent__ = None
|
__parent__ = None
|
||||||
__name__ = 'root'
|
__name__ = 'root'
|
||||||
|
|
|
@ -1,28 +1,8 @@
|
||||||
#
|
# cybertools.roa.json
|
||||||
# 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
|
|
||||||
#
|
|
||||||
|
|
||||||
"""
|
""" Adapter(s)/view(s) for providing object attributes and other data in JSON format.
|
||||||
Adapter(s)/view(s) for providing object attributes and other data in JSON format.
|
|
||||||
|
|
||||||
$Id$
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from zope.interface import implements
|
|
||||||
from cybertools.util import json
|
from cybertools.util import json
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,33 +1,15 @@
|
||||||
#
|
# cybertools.tracking.comment.base
|
||||||
# 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
|
|
||||||
#
|
|
||||||
|
|
||||||
"""
|
""" Basic implementation of comments / discussions.
|
||||||
Basic implementation of comments / discussions.
|
|
||||||
|
|
||||||
$Id$
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from zope.interface import implements
|
from zope.interface import implementer
|
||||||
|
|
||||||
from cybertools.tracking.btree import Track
|
from cybertools.tracking.btree import Track
|
||||||
from cybertools.tracking.comment.interfaces import IComment
|
from cybertools.tracking.comment.interfaces import IComment
|
||||||
|
|
||||||
|
|
||||||
|
@implementer(IComment)
|
||||||
class Comment(Track):
|
class Comment(Track):
|
||||||
|
|
||||||
implements(IComment)
|
pass
|
||||||
|
|
|
@ -1,32 +1,13 @@
|
||||||
#
|
# cybertools.z2.generic
|
||||||
# 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
|
|
||||||
#
|
|
||||||
|
|
||||||
"""
|
""" Base classes.
|
||||||
Base classes.
|
|
||||||
|
|
||||||
$Id$
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from Acquisition import aq_inner, aq_parent
|
from Acquisition import aq_inner, aq_parent
|
||||||
from persistent.mapping import PersistentMapping
|
from persistent.mapping import PersistentMapping
|
||||||
from zope.app.container.interfaces import IObjectAddedEvent
|
from zope.app.container.interfaces import IObjectAddedEvent
|
||||||
from zope import component
|
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 IGeneric
|
||||||
from cybertools.util.generic.interfaces import IGenericObject, IGenericFolder
|
from cybertools.util.generic.interfaces import IGenericObject, IGenericFolder
|
||||||
|
@ -35,14 +16,13 @@ from cybertools.util.generic.interfaces import IGenericObject, IGenericFolder
|
||||||
_not_found = object()
|
_not_found = object()
|
||||||
|
|
||||||
|
|
||||||
|
@implementer(IGenericObject)
|
||||||
class GenericObject(object):
|
class GenericObject(object):
|
||||||
""" A mixin class supporting generic attribute access and other
|
""" A mixin class supporting generic attribute access and other
|
||||||
basic or common functionality when combined with Zope2's
|
basic or common functionality when combined with Zope2's
|
||||||
SimpleItem.
|
SimpleItem.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
implements(IGenericObject)
|
|
||||||
|
|
||||||
typeInterface = None
|
typeInterface = None
|
||||||
|
|
||||||
def setup(self):
|
def setup(self):
|
||||||
|
@ -68,13 +48,12 @@ class GenericObject(object):
|
||||||
self.getParent().manage_renameObject(self.name, newName)
|
self.getParent().manage_renameObject(self.name, newName)
|
||||||
|
|
||||||
|
|
||||||
|
@implementer(IGenericFolder)
|
||||||
class GenericFolder(GenericObject):
|
class GenericFolder(GenericObject):
|
||||||
""" Provide generic (i.e. dictionary-like) folder access to Zope2's
|
""" Provide generic (i.e. dictionary-like) folder access to Zope2's
|
||||||
Folder or BTreeFolder.
|
Folder or BTreeFolder.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
implements(IGenericFolder)
|
|
||||||
|
|
||||||
def __getitem__(self, name):
|
def __getitem__(self, name):
|
||||||
return getattr(self, name)
|
return getattr(self, name)
|
||||||
|
|
||||||
|
|
|
@ -8,13 +8,13 @@ from zope.app.intid.interfaces import IntIdAddedEvent, IntIdRemovedEvent
|
||||||
from zope.app.container.interfaces import IObjectAddedEvent, IObjectRemovedEvent
|
from zope.app.container.interfaces import IObjectAddedEvent, IObjectRemovedEvent
|
||||||
from zope.app.keyreference.interfaces import IKeyReference, NotYet
|
from zope.app.keyreference.interfaces import IKeyReference, NotYet
|
||||||
from zope.event import notify
|
from zope.event import notify
|
||||||
from zope.interface import implements
|
from zope.interface import implementer
|
||||||
|
|
||||||
_marker = []
|
_marker = []
|
||||||
|
|
||||||
|
@implementer(IIntIds)
|
||||||
class IntIds(z3IntIds):
|
class IntIds(z3IntIds):
|
||||||
""" zope2ish intid utility """
|
""" zope2ish intid utility """
|
||||||
implements(IIntIds)
|
|
||||||
|
|
||||||
meta_type="IntId Utility"
|
meta_type="IntId Utility"
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ from zExceptions import NotFound
|
||||||
from persistent import IPersistent
|
from persistent import IPersistent
|
||||||
from zope.component import adapter, adapts
|
from zope.component import adapter, adapts
|
||||||
from zope.app.component.hooks import getSite
|
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.interfaces import IKeyReference, NotYet
|
||||||
from zope.app.keyreference.persistent import KeyReferenceToPersistent
|
from zope.app.keyreference.persistent import KeyReferenceToPersistent
|
||||||
from site import get_root, aq_iter
|
from site import get_root, aq_iter
|
||||||
|
@ -30,6 +30,7 @@ def add_object_to_connection(ob, event):
|
||||||
connection.add(aq_base(ob))
|
connection.add(aq_base(ob))
|
||||||
|
|
||||||
|
|
||||||
|
@implementer(IKeyReference)
|
||||||
class KeyReferenceToPersistent(KeyReferenceToPersistent):
|
class KeyReferenceToPersistent(KeyReferenceToPersistent):
|
||||||
"""a zope2ish implementation of keyreferences that unwraps objects
|
"""a zope2ish implementation of keyreferences that unwraps objects
|
||||||
that have Acquisition wrappers
|
that have Acquisition wrappers
|
||||||
|
@ -38,7 +39,6 @@ class KeyReferenceToPersistent(KeyReferenceToPersistent):
|
||||||
|
|
||||||
@@ cache IConnection as a property and volative attr?
|
@@ cache IConnection as a property and volative attr?
|
||||||
"""
|
"""
|
||||||
implements(IKeyReference)
|
|
||||||
adapts(IPersistent)
|
adapts(IPersistent)
|
||||||
|
|
||||||
key_type_id = 'five.intid.keyreference'
|
key_type_id = 'five.intid.keyreference'
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# Sometimes persistent classes are never meant to be persisted. The most
|
# Sometimes persistent classes are never meant to be persisted. The most
|
||||||
# common example are CMFCore directory views and filesystem objects.
|
# common example are CMFCore directory views and filesystem objects.
|
||||||
# Register specific handlers that are no-ops to circumvent
|
# 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
|
from zope.app.keyreference.interfaces import IKeyReference, NotYet
|
||||||
|
|
||||||
def addIntIdSubscriber(ob, event):
|
def addIntIdSubscriber(ob, event):
|
||||||
|
@ -13,9 +13,9 @@ def removeIntIdSubscriber(ob, event):
|
||||||
def moveIntIdSubscriber(ob, event):
|
def moveIntIdSubscriber(ob, event):
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@implementer(IKeyReference)
|
||||||
class KeyReferenceNever(object):
|
class KeyReferenceNever(object):
|
||||||
"""A keyreference that is never ready"""
|
"""A keyreference that is never ready"""
|
||||||
implements(IKeyReference)
|
|
||||||
|
|
||||||
key_type_id = 'five.intid.cmfexceptions.keyreference'
|
key_type_id = 'five.intid.cmfexceptions.keyreference'
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue