work in progress: make cybertools package work with BlueBream 1.0

This commit is contained in:
Helmut Merz 2011-09-29 18:17:35 +02:00
parent 1aa90f68a2
commit f0e789d844
31 changed files with 132 additions and 61 deletions

View file

@ -1,5 +1,5 @@
# #
# Copyright (c) 2006 Helmut Merz helmutm@cy55.de # Copyright (c) 2011 Helmut Merz helmutm@cy55.de
# #
# This program is free software; you can redistribute it and/or modify # 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 # it under the terms of the GNU General Public License as published by
@ -23,7 +23,6 @@ $Id$
""" """
from zope.app.publisher. browser import menu from zope.app.publisher. browser import menu
from zope.app.securitypolicy.interfaces import IPrincipalRoleManager
from zope.security import checkPermission from zope.security import checkPermission
class MenuAccessView(menu.MenuAccessView): class MenuAccessView(menu.MenuAccessView):

View file

@ -4,7 +4,6 @@ import unittest, doctest
from zope.testing.doctestunit import DocFileSuite from zope.testing.doctestunit import DocFileSuite
from zope.app.testing import ztapi from zope.app.testing import ztapi
from zope.interface.verify import verifyClass from zope.interface.verify import verifyClass
from zope.app import zapi
def test_suite(): def test_suite():

View file

@ -1,5 +1,5 @@
# #
# Copyright (c) 2008 Helmut Merz helmutm@cy55.de # Copyright (c) 2011 Helmut Merz helmutm@cy55.de
# #
# This program is free software; you can redistribute it and/or modify # 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 # it under the terms of the GNU General Public License as published by
@ -28,12 +28,12 @@ $Id$
from BTrees.IFBTree import weightedIntersection, weightedUnion from BTrees.IFBTree import weightedIntersection, weightedUnion
from BTrees.IFBTree import difference, IFBTree, IFBucket, IFSet from BTrees.IFBTree import difference, IFBTree, IFBucket, IFSet
from BTrees.IIBTree import IISet, union from BTrees.IIBTree import IISet, union
from zope.app.intid.interfaces import IIntIds
from zope.app.catalog.catalog import ResultSet from zope.app.catalog.catalog import ResultSet
from zope.app.catalog.field import IFieldIndex from zope.app.catalog.field import IFieldIndex
from zope.app.catalog.text import ITextIndex from zope.app.catalog.text import ITextIndex
from zope.app.catalog.interfaces import ICatalog from zope.app.catalog.interfaces import ICatalog
from zope import component from zope import component
from zope.intid.interfaces import IIntIds
from cybertools.catalog.keyword import IKeywordIndex from cybertools.catalog.keyword import IKeywordIndex

View file

@ -1,6 +1,6 @@
#-*- coding: UTF-8 -*- #-*- coding: UTF-8 -*-
# #
# Copyright (c) 2009 Helmut Merz helmutm@cy55.de # Copyright (c) 2011 Helmut Merz helmutm@cy55.de
# #
# This program is free software; you can redistribute it and/or modify # 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 # it under the terms of the GNU General Public License as published by
@ -23,8 +23,8 @@ Common functionality.
$Id$ $Id$
""" """
from zope.app.intid.interfaces import IIntIds
from zope import component from zope import component
from zope.intid.interfaces import IIntIds
class ContainerAttribute(object): class ContainerAttribute(object):

View file

@ -28,11 +28,11 @@ from zope.schema.vocabulary import SimpleVocabulary, SimpleTerm
from zope.interface import Interface, Attribute from zope.interface import Interface, Attribute
from zope.i18nmessageid import MessageFactory from zope.i18nmessageid import MessageFactory
from cybertools.util.jeep import Jeep, Term
from cybertools.organize.interfaces import IAddress as IBaseAddress from cybertools.organize.interfaces import IAddress as IBaseAddress
from cybertools.organize.interfaces import IPerson as IBasePerson from cybertools.organize.interfaces import IPerson as IBasePerson
from cybertools.tracking.interfaces import ITrack from cybertools.tracking.interfaces import ITrack
from loops import util from cybertools.util.jeep import Jeep, Term
from cybertools.util import util
_ = MessageFactory('cybertools.commerce') _ = MessageFactory('cybertools.commerce')

View file

@ -1,5 +1,5 @@
# #
# Copyright (c) 2009 Helmut Merz helmutm@cy55.de # Copyright (c) 2011 Helmut Merz helmutm@cy55.de
# #
# This program is free software; you can redistribute it and/or modify # 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 # it under the terms of the GNU General Public License as published by
@ -22,11 +22,11 @@ Order and order item classes.
$Id$ $Id$
""" """
from zope.app.intid.interfaces import IIntIds
from zope.cachedescriptors.property import Lazy from zope.cachedescriptors.property import Lazy
from zope import component from zope import component
from zope.component import adapts from zope.component import adapts
from zope.interface import implements, Interface from zope.interface import implements, Interface
from zope.intid.interfaces import IIntIds
from cybertools.commerce.common import getUidForObject, getObjectForUid from cybertools.commerce.common import getUidForObject, getObjectForUid
from cybertools.commerce.common import Relation, BaseObject from cybertools.commerce.common import Relation, BaseObject

View file

@ -9,9 +9,9 @@ $Id$
import unittest, doctest import unittest, doctest
from zope.testing.doctestunit import DocFileSuite from zope.testing.doctestunit import DocFileSuite
from zope.app.intid.interfaces import IIntIds
from zope import component from zope import component
from zope.interface import implements from zope.interface import implements
from zope.intid.interfaces import IIntIds
from cybertools.commerce.order import OrderItems from cybertools.commerce.order import OrderItems
from cybertools.commerce.product import Product from cybertools.commerce.product import Product

View file

@ -1,5 +1,5 @@
# #
# Copyright (c) 2010 Helmut Merz helmutm@cy55.de # Copyright (c) 2011 Helmut Merz helmutm@cy55.de
# #
# This program is free software; you can redistribute it and/or modify # 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 # it under the terms of the GNU General Public License as published by
@ -60,7 +60,7 @@ class Field(Component):
self.__name__ = name self.__name__ = name
title = title or name title = title or name
self.fieldType = fieldType self.fieldType = fieldType
super(Field, self).__init__(title, __name__=name, **kw) #super(Field, self).__init__(title, __name__=name, **kw)
self.title = title self.title = title
for k, v in kw.items(): for k, v in kw.items():
setattr(self, k, v) setattr(self, k, v)

View file

@ -71,7 +71,7 @@ class Field(Component):
#title = title or u'' #title = title or u''
title = title or name title = title or name
self.fieldType = fieldType self.fieldType = fieldType
super(Field, self).__init__(title, __name__=name, **kw) #super(Field, self).__init__(title, __name__=name, **kw)
self.title = title self.title = title
for k, v in kw.items(): for k, v in kw.items():
setattr(self, k, v) setattr(self, k, v)

View file

@ -1,5 +1,5 @@
# #
# Copyright (c) 2006 Helmut Merz helmutm@cy55.de # Copyright (c) 2011 Helmut Merz helmutm@cy55.de
# #
# This program is free software; you can redistribute it and/or modify # 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 # it under the terms of the GNU General Public License as published by
@ -22,7 +22,6 @@ Ordered container implementation.
$Id$ $Id$
""" """
from zope.app import zapi
from zope.app.container.ordered import OrderedContainer as BaseOrderedContainer from zope.app.container.ordered import OrderedContainer as BaseOrderedContainer
from zope.cachedescriptors.property import Lazy from zope.cachedescriptors.property import Lazy
from zope.app.i18n import ZopeMessageFactory as _ from zope.app.i18n import ZopeMessageFactory as _

View file

@ -1,5 +1,5 @@
# #
# Copyright (c) 2010 Helmut Merz helmutm@cy55.de # Copyright (c) 2011 Helmut Merz helmutm@cy55.de
# #
# This program is free software; you can redistribute it and/or modify # 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 # it under the terms of the GNU General Public License as published by
@ -29,7 +29,7 @@ from zope import component
from zope.component import adapts from zope.component import adapts
from zope.index.field import FieldIndex from zope.index.field import FieldIndex
from zope.interface import implements from zope.interface import implements
from zope.app.intid.interfaces import IIntIds from zope.intid.interfaces import IIntIds
from cybertools.link.interfaces import ILinkManager, ILink from cybertools.link.interfaces import ILinkManager, ILink

View file

@ -4,7 +4,7 @@ import unittest
from zope.testing.doctestunit import DocFileSuite from zope.testing.doctestunit import DocFileSuite
from zope.interface.verify import verifyClass from zope.interface.verify import verifyClass
from zope.interface import implements from zope.interface import implements
from zope.app.intid.interfaces import IIntIds from zope.intid.interfaces import IIntIds
class IntIdsStub(object): class IntIdsStub(object):

View file

@ -8,7 +8,6 @@ $Id$
import os import os
import unittest, doctest import unittest, doctest
from zope.testing.doctestunit import DocFileSuite
from zope.interface.verify import verifyClass from zope.interface.verify import verifyClass
from cybertools import media from cybertools import media
@ -37,7 +36,7 @@ def test_suite():
flags = doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS flags = doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS
return unittest.TestSuite(( return unittest.TestSuite((
unittest.makeSuite(Test), unittest.makeSuite(Test),
DocFileSuite('README.txt', optionflags=flags), doctest.DocFileSuite('README.txt', optionflags=flags),
)) ))
if __name__ == '__main__': if __name__ == '__main__':

View file

@ -75,14 +75,14 @@ Note: We cannot just print the error directly, since there is a
of the source correctly. So we construct an information string by hand. of the source correctly. So we construct an information string by hand.
>>> def print_err(err): >>> def print_err(err):
... print ('%(msg)s, %(filename)s, line %(lineno)i, offset %(offset)i' ... print ('%s, %s, line %i, offset %i'
... % err.__dict__) ... % (err.msg, err.filename, err.lineno, err.offset))
... ...
>>> try: >>> try:
... pp.setSource(u"'''<html>...</html>") #'''" ... pp.setSource(u"'''<html>...</html>") #'''"
... except SyntaxError, err: ... except SyntaxError, err:
... print_err(err) ... print_err(err)
EOF while scanning triple-quoted string, /pp, line 4, offset 47 EOF while scanning triple-quoted string literal, /pp, line 4, offset 48
>>> try: >>> try:
... pp.setSource(u"prin 'hello'") ... pp.setSource(u"prin 'hello'")

View file

@ -9,7 +9,6 @@ import unittest, doctest
from zope import component from zope import component
from zope.interface import implements from zope.interface import implements
from zope.location.traversing import LocationPhysicallyLocatable from zope.location.traversing import LocationPhysicallyLocatable
from zope.testing.doctestunit import DocFileSuite
from zope.traversing.interfaces import IContainmentRoot from zope.traversing.interfaces import IContainmentRoot
from zope.traversing.interfaces import IPhysicallyLocatable from zope.traversing.interfaces import IPhysicallyLocatable
from zope.traversing.adapters import RootPhysicallyLocatable from zope.traversing.adapters import RootPhysicallyLocatable
@ -33,10 +32,10 @@ def setUp(test):
def test_suite(): def test_suite():
flags = doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS flags = doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS
suites = [DocFileSuite('README.txt', optionflags=flags, suites = [doctest.DocFileSuite('README.txt', optionflags=flags,
setUp=setUp, tearDown=placelesssetup.tearDown)] setUp=setUp, tearDown=placelesssetup.tearDown)]
if HAS_R: if HAS_R:
suites.append(DocFileSuite('rstat.txt', optionflags=flags, suites.append(doctest.DocFileSuite('rstat.txt', optionflags=flags,
setUp=setUp, tearDown=placelesssetup.tearDown)) setUp=setUp, tearDown=placelesssetup.tearDown))
return unittest.TestSuite(suites) return unittest.TestSuite(suites)

View file

@ -214,8 +214,8 @@ working with events).
>>> from zope.app.testing import ztapi >>> from zope.app.testing import ztapi
>>> ztapi.provideUtility(IRelationRegistry, RelationRegistry()) >>> ztapi.provideUtility(IRelationRegistry, RelationRegistry())
>>> from zope.app import zapi >>> import zope.component
>>> relations = zapi.getUtility(IRelationRegistry) >>> relations = zope.component.getUtility(IRelationRegistry)
In real life the indexes needed will be set up via subscription to In real life the indexes needed will be set up via subscription to
IObjectCreatedEvent - here we have to do this explicitly: IObjectCreatedEvent - here we have to do this explicitly:
@ -229,9 +229,9 @@ register the objects with it (in real life this is done automatically
when we add an object to a container): when we add an object to a container):
>>> from cybertools.relation.tests import IntIdsStub >>> from cybertools.relation.tests import IntIdsStub
>>> from zope.app.intid.interfaces import IIntIds >>> from zope.intid.interfaces import IIntIds
>>> ztapi.provideUtility(IIntIds, IntIdsStub()) >>> ztapi.provideUtility(IIntIds, IntIdsStub())
>>> intids = zapi.getUtility(IIntIds) >>> intids = zope.component.getUtility(IIntIds)
>>> intids.register(clark) >>> intids.register(clark)
0 0
>>> intids.register(kirk) >>> intids.register(kirk)

View file

@ -1,5 +1,5 @@
# #
# Copyright (c) 2009 Helmut Merz helmutm@cy55.de # Copyright (c) 2011 Helmut Merz helmutm@cy55.de
# #
# This program is free software; you can redistribute it and/or modify # 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 # it under the terms of the GNU General Public License as published by
@ -31,7 +31,7 @@ from zope.component import adapts
from zope.interface import Interface, Attribute, implements from zope.interface import Interface, Attribute, implements
from zope.app.catalog.catalog import Catalog, ResultSet from zope.app.catalog.catalog import Catalog, ResultSet
from zope.app.catalog.field import FieldIndex from zope.app.catalog.field import FieldIndex
from zope.app.intid.interfaces import IIntIds from zope.intid.interfaces import IIntIds
from zope.location.interfaces import ILocation from zope.location.interfaces import ILocation
from zope.event import notify from zope.event import notify
from zope.component.interfaces import ObjectEvent from zope.component.interfaces import ObjectEvent

View file

@ -1,12 +1,10 @@
# $Id$ # $Id$
import unittest import unittest
from zope.testing.doctestunit import DocFileSuite
from zope.app.testing import ztapi from zope.app.testing import ztapi
from zope.interface.verify import verifyClass from zope.interface.verify import verifyClass
from zope.interface import implements from zope.interface import implements
from zope.app import zapi from zope.intid.interfaces import IIntIds
from zope.app.intid.interfaces import IIntIds
from cybertools.relation.interfaces import IDyadicRelation, ITriadicRelation from cybertools.relation.interfaces import IDyadicRelation, ITriadicRelation
from cybertools.relation.interfaces import IRelation, IPredicate from cybertools.relation.interfaces import IRelation, IPredicate
@ -62,7 +60,7 @@ class TestRelation(unittest.TestCase):
def test_suite(): def test_suite():
return unittest.TestSuite(( return unittest.TestSuite((
unittest.makeSuite(TestRelation), unittest.makeSuite(TestRelation),
DocFileSuite('README.txt'), doctest.DocFileSuite('README.txt'),
)) ))
if __name__ == '__main__': if __name__ == '__main__':

View file

@ -1,11 +1,9 @@
# $Id$ # $Id$
import unittest, doctest import unittest, doctest
from zope.testing.doctestunit import DocFileSuite
from zope.app.testing import ztapi from zope.app.testing import ztapi
from zope.interface.verify import verifyClass from zope.interface.verify import verifyClass
from zope.interface import implements from zope.interface import implements
from zope.app import zapi
from cybertools.reporter.interfaces import IResultSet, IRow, ICell from cybertools.reporter.interfaces import IResultSet, IRow, ICell
@ -21,7 +19,7 @@ def test_suite():
flags = doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS flags = doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS
return unittest.TestSuite(( return unittest.TestSuite((
unittest.makeSuite(TestReporter), unittest.makeSuite(TestReporter),
DocFileSuite('README.txt', optionflags=flags), doctest.DocFileSuite('README.txt', optionflags=flags),
)) ))
if __name__ == '__main__': if __name__ == '__main__':

3
setup.cfg Normal file
View file

@ -0,0 +1,3 @@
[egg_info]
tag_build = dev
tag_svn_revision = true

32
setup.py Normal file
View file

@ -0,0 +1,32 @@
from setuptools import setup, find_packages
import sys, os
version = '2.0'
setup(name='cybertools',
version=version,
description="cybertools",
long_description="""\
""",
classifiers=[], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers
keywords='',
author='Helmut Merz',
author_email='helmutm@cy55.de',
url='',
license='GPL',
packages=find_packages(exclude=['ez_setup', 'examples', 'tests']),
include_package_data=True,
zip_safe=False,
install_requires=[
# -*- Extra requirements: -*-
'lxml',
'PIL',
'zope.app.catalog',
'zope.app.file',
'zope.app.session',
'zope.sendmail',
],
entry_points="""
# -*- Entry points: -*-
""",
)

View file

@ -1,5 +1,5 @@
# #
# Copyright (c) 2007 Helmut Merz helmutm@cy55.de # Copyright (c) 2011 Helmut Merz helmutm@cy55.de
# #
# This program is free software; you can redistribute it and/or modify # 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 # it under the terms of the GNU General Public License as published by
@ -22,13 +22,13 @@ Storage manager implementation for a full Zope 3 environment.
$Id$ $Id$
""" """
from persistent import Persistent
from zope import component from zope import component
from zope.interface import implements from zope.interface import implements
from zope.app.component.hooks import getSite from zope.app.component.hooks import getSite
from zope.app.container.interfaces import IContained from zope.app.container.interfaces import IContained
from zope.app.intid.interfaces import IIntIds from zope.intid.interfaces import IIntIds
from zope.traversing.api import traverse, getPath from zope.traversing.api import traverse, getPath
from persistent import Persistent
from cybertools.util.adapter import AdapterFactory from cybertools.util.adapter import AdapterFactory

View file

@ -8,7 +8,7 @@ arbitrary objects with types that may then be used for controlling
execution of code, helping with search interfaces or editing of execution of code, helping with search interfaces or editing of
object data. object data.
>>> from zope.app import zapi >>> from zope import component
>>> from zope.app.testing import ztapi >>> from zope.app.testing import ztapi
>>> from cybertools.typology.interfaces import IType, ITypeManager >>> from cybertools.typology.interfaces import IType, ITypeManager
@ -87,7 +87,7 @@ only persons of a certain age group we need a list of available types
This is where type managers come in. A type manager is a utility or This is where type managers come in. A type manager is a utility or
another (possibly persistent) object knowing about the available types. another (possibly persistent) object knowing about the available types.
>>> typeManager = zapi.getUtility(IAgeGroupManager) >>> typeManager = component.getUtility(IAgeGroupManager)
>>> types = typeManager.types >>> types = typeManager.types
>>> [t.title for t in types] >>> [t.title for t in types]
[u'Child', u'Adult'] [u'Child', u'Adult']

View file

@ -1,11 +1,9 @@
# $Id$ # $Id$
import unittest import unittest, doctest
from zope.testing.doctestunit import DocFileSuite
from zope.app.testing import ztapi from zope.app.testing import ztapi
from zope.interface.verify import verifyClass from zope.interface.verify import verifyClass
from zope.interface import implements from zope.interface import implements
from zope.app import zapi
from cybertools.typology.interfaces import IType, ITypeManager from cybertools.typology.interfaces import IType, ITypeManager
@ -20,7 +18,7 @@ class TestTypology(unittest.TestCase):
def test_suite(): def test_suite():
return unittest.TestSuite(( return unittest.TestSuite((
unittest.makeSuite(TestTypology), unittest.makeSuite(TestTypology),
DocFileSuite('README.txt'), doctest.DocFileSuite('README.txt'),
)) ))
if __name__ == '__main__': if __name__ == '__main__':

42
util/util.py Normal file
View file

@ -0,0 +1,42 @@
#
# Copyright (c) 2011 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
#
"""
Utility functions.
$Id$
"""
from zope.schema import vocabulary
class KeywordVocabulary(vocabulary.SimpleVocabulary):
def __init__(self, items, *interfaces):
""" ``items`` may be a tuple of (token, title) or a dictionary
with corresponding elements named 'token' and 'title'.
"""
terms = []
for t in items:
if type(t) is dict:
token, title = t['token'], t['title']
else:
token, title = t
terms.append(vocabulary.SimpleTerm(token, token, title))
super(KeywordVocabulary, self).__init__(terms, *interfaces)

View file

@ -22,9 +22,9 @@ A Wiki manager managing wikis and wiki-related objects, esp plugins.
$Id$ $Id$
""" """
from zope.app.intid.interfaces import IIntIds
from zope import component from zope import component
from zope.interface import implements from zope.interface import implements
from zope.intid.interfaces import IIntIds
from zope.traversing.browser import absoluteURL from zope.traversing.browser import absoluteURL
from cybertools.wiki.common import protocols, ExternalPage from cybertools.wiki.common import protocols, ExternalPage

View file

@ -31,6 +31,14 @@ from zope.interface import implements
from cybertools.wiki.interfaces import INodeProcessor, IWriter from cybertools.wiki.interfaces import INodeProcessor, IWriter
class HTMLWriter(HTMLWriter):
def apply_template(self):
template = '%(body_pre_docinfo)s\n%(docinfo)s\n%(body)s'
subs = self.interpolation_dict()
return template % subs
class Writer(object): class Writer(object):
implements(IWriter) implements(IWriter)

View file

@ -1,5 +1,5 @@
# #
# Copyright (c) 2009 Helmut Merz helmutm@cy55.de # Copyright (c) 2011 Helmut Merz helmutm@cy55.de
# #
# This program is free software; you can redistribute it and/or modify # 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 # it under the terms of the GNU General Public License as published by
@ -29,12 +29,12 @@ except ImportError:
from BTrees.IOBTree import IOTreeSet from BTrees.IOBTree import IOTreeSet
from BTrees.OOBTree import OOBTree from BTrees.OOBTree import OOBTree
from persistent.mapping import PersistentMapping from persistent.mapping import PersistentMapping
from zope.app.intid import IntIds
from zope.app.intid.interfaces import IIntIds
from zope.cachedescriptors.property import Lazy from zope.cachedescriptors.property import Lazy
from zope import component from zope import component
from zope.component import adapts from zope.component import adapts
from zope.interface import implements from zope.interface import implements
from zope.intid import IntIds
from zope.intid.interfaces import IIntIds
from cybertools.link.base import Link, LinkManager from cybertools.link.base import Link, LinkManager
from cybertools.util.generic.interfaces import IGenericObject, IGenericFolder from cybertools.util.generic.interfaces import IGenericObject, IGenericFolder

View file

@ -7,10 +7,9 @@ $Id$
""" """
import unittest, doctest import unittest, doctest
from zope.testing.doctestunit import DocFileSuite
from zope import component from zope import component
from zope.interface import implements from zope.interface import implements
from zope.app.intid.interfaces import IIntIds from zope.intid.interfaces import IIntIds
from zope.publisher.interfaces.browser import IBrowserRequest from zope.publisher.interfaces.browser import IBrowserRequest
from zope.traversing.browser.interfaces import IAbsoluteURL from zope.traversing.browser.interfaces import IAbsoluteURL
@ -80,8 +79,8 @@ def test_suite():
flags = doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS flags = doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS
return unittest.TestSuite(( return unittest.TestSuite((
unittest.makeSuite(Test), unittest.makeSuite(Test),
DocFileSuite('README.txt', optionflags=flags, setUp=setUp), doctest.DocFileSuite('README.txt', optionflags=flags, setUp=setUp),
DocFileSuite('preproc/README.txt', optionflags=flags), doctest.DocFileSuite('preproc/README.txt', optionflags=flags),
)) ))
if __name__ == '__main__': if __name__ == '__main__':

View file

@ -4,7 +4,6 @@ External Editor
($Id$) ($Id$)
>>> from zope.app.testing import ztapi >>> from zope.app.testing import ztapi
>>> from zope.app import zapi
>>> from cybertools.xedit import interfaces >>> from cybertools.xedit import interfaces
>>> from cybertools.xedit.browser import ExternalEditorView >>> from cybertools.xedit.browser import ExternalEditorView

View file

@ -1,13 +1,12 @@
# $Id$ # $Id$
import unittest, doctest import unittest, doctest
from zope.testing.doctestunit import DocFileSuite
def test_suite(): def test_suite():
flags = doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS flags = doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS
return unittest.TestSuite(( return unittest.TestSuite((
DocFileSuite('README.txt', optionflags=flags), doctest.DocFileSuite('README.txt', optionflags=flags),
)) ))
if __name__ == '__main__': if __name__ == '__main__':