diff --git a/cybertools/external/base.py b/cybertools/external/base.py index 9a9c97a..dde3671 100644 --- a/cybertools/external/base.py +++ b/cybertools/external/base.py @@ -1,40 +1,21 @@ -# -# 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 -# -""" -Base implementation for import adapters. +# cybertools.external.base -$Id$ +""" Base implementation for import adapters. """ -from cStringIO import StringIO +from io import StringIO from logging import getLogger from zope import component -from zope.interface import implements +from zope.interface import implementer from zope.cachedescriptors.property import Lazy from cybertools.external.interfaces import IReader, ILoader +@implementer(IReader) class BaseReader(object): - implements(IReader) - def __init__(self, context): self.context = context @@ -42,10 +23,9 @@ class BaseReader(object): return [] +@implementer(ILoader) class BaseLoader(object): - implements(ILoader) - def __init__(self, context): self.context = context self.changes = [] diff --git a/cybertools/external/element.py b/cybertools/external/element.py index 7e17a0e..3448a1b 100644 --- a/cybertools/external/element.py +++ b/cybertools/external/element.py @@ -1,33 +1,14 @@ -# -# 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.external.element -""" -Basic implementation of the elements used for the intermediate format for export +""" Basic implementation of the elements used for the intermediate format for export and import of objects. - -$Id$ """ import os from zope import component from zope.cachedescriptors.property import Lazy from zope.dottedname.resolve import resolve -from zope.interface import Interface, implements +from zope.interface import Interface, implementer from zope.traversing.api import getName, traverse from cybertools.composer.interfaces import IInstance @@ -35,10 +16,9 @@ from cybertools.composer.schema.interfaces import ISchemaFactory from cybertools.external.interfaces import IElement +@implementer(IElement) class Element(dict): - implements(IElement) - encoding = 'UTF-8' type = '' identifierName = ''