external: some Python3 fixes
This commit is contained in:
parent
e98dd2ed34
commit
b60d6d3b10
2 changed files with 10 additions and 50 deletions
32
cybertools/external/base.py
vendored
32
cybertools/external/base.py
vendored
|
@ -1,40 +1,21 @@
|
||||||
#
|
# cybertools.external.base
|
||||||
# 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.
|
|
||||||
|
|
||||||
$Id$
|
""" Base implementation for import adapters.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from cStringIO import StringIO
|
from io import StringIO
|
||||||
from logging import getLogger
|
from logging import getLogger
|
||||||
|
|
||||||
from zope import component
|
from zope import component
|
||||||
from zope.interface import implements
|
from zope.interface import implementer
|
||||||
from zope.cachedescriptors.property import Lazy
|
from zope.cachedescriptors.property import Lazy
|
||||||
|
|
||||||
from cybertools.external.interfaces import IReader, ILoader
|
from cybertools.external.interfaces import IReader, ILoader
|
||||||
|
|
||||||
|
|
||||||
|
@implementer(IReader)
|
||||||
class BaseReader(object):
|
class BaseReader(object):
|
||||||
|
|
||||||
implements(IReader)
|
|
||||||
|
|
||||||
def __init__(self, context):
|
def __init__(self, context):
|
||||||
self.context = context
|
self.context = context
|
||||||
|
|
||||||
|
@ -42,10 +23,9 @@ class BaseReader(object):
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
|
||||||
|
@implementer(ILoader)
|
||||||
class BaseLoader(object):
|
class BaseLoader(object):
|
||||||
|
|
||||||
implements(ILoader)
|
|
||||||
|
|
||||||
def __init__(self, context):
|
def __init__(self, context):
|
||||||
self.context = context
|
self.context = context
|
||||||
self.changes = []
|
self.changes = []
|
||||||
|
|
28
cybertools/external/element.py
vendored
28
cybertools/external/element.py
vendored
|
@ -1,33 +1,14 @@
|
||||||
#
|
# cybertools.external.element
|
||||||
# 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
|
|
||||||
#
|
|
||||||
|
|
||||||
"""
|
""" 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.
|
and import of objects.
|
||||||
|
|
||||||
$Id$
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import os
|
import os
|
||||||
from zope import component
|
from zope import component
|
||||||
from zope.cachedescriptors.property import Lazy
|
from zope.cachedescriptors.property import Lazy
|
||||||
from zope.dottedname.resolve import resolve
|
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 zope.traversing.api import getName, traverse
|
||||||
|
|
||||||
from cybertools.composer.interfaces import IInstance
|
from cybertools.composer.interfaces import IInstance
|
||||||
|
@ -35,10 +16,9 @@ from cybertools.composer.schema.interfaces import ISchemaFactory
|
||||||
from cybertools.external.interfaces import IElement
|
from cybertools.external.interfaces import IElement
|
||||||
|
|
||||||
|
|
||||||
|
@implementer(IElement)
|
||||||
class Element(dict):
|
class Element(dict):
|
||||||
|
|
||||||
implements(IElement)
|
|
||||||
|
|
||||||
encoding = 'UTF-8'
|
encoding = 'UTF-8'
|
||||||
type = ''
|
type = ''
|
||||||
identifierName = ''
|
identifierName = ''
|
||||||
|
|
Loading…
Add table
Reference in a new issue