>> print linksPage.render(TestRequest())
+ >>> print(linksPage.render(TestRequest()))
A collection of interesting links
- >> print linksPage.render(TestRequest())
+ >>> print(linksPage.render(TestRequest()))
A collection of interesting links
- `_
... '''
- >>> print imagePage1.render(TestRequest())
+ >>> print(imagePage1.render(TestRequest()))
A page with an image
`_
... '''
- >>> print imagePage2.render(TestRequest())
+ >>> print(imagePage2.render(TestRequest()))
A page with a link to an image
Media Object #1
diff --git a/cybertools/wiki/base/config.py b/cybertools/wiki/base/config.py
index a1f5dd9..b9b01c7 100644
--- a/cybertools/wiki/base/config.py
+++ b/cybertools/wiki/base/config.py
@@ -1,36 +1,16 @@
-#
-# 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.wiki.base.config
-"""
-Basic Configuration implementations.
-
-$Id$
+""" Basic Configuration implementations.
"""
-from zope.interface import implements
+from zope.interface import implementer
from cybertools.wiki.interfaces import IWikiConfigInfo, IWikiConfiguration
+@implementer(IWikiConfigInfo)
class WikiConfigInfo(dict):
- implements(IWikiConfigInfo)
-
def set(self, functionality, value):
self[functionality] = value
@@ -52,12 +32,11 @@ class BaseConfigurator(object):
return self.context._configInfo
+@implementer(IWikiConfiguration)
class BaseConfiguration(object):
""" The base class for all wiki configuration implementations.
"""
- implements(IWikiConfiguration)
-
configurator = BaseConfigurator
_configInfo = None
diff --git a/cybertools/wiki/base/link.py b/cybertools/wiki/base/link.py
index 59d247e..ad63600 100644
--- a/cybertools/wiki/base/link.py
+++ b/cybertools/wiki/base/link.py
@@ -1,40 +1,20 @@
-#
-# 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.wiki.base.link
-"""
-Basic (sample) implementations for links and link management.
-
-$Id$
+""" Basic (sample) implementations for links and link management.
"""
from docutils.nodes import Text
-from zope.interface import implements
+from zope.interface import implementer
from zope.traversing.browser import absoluteURL
from cybertools.link.interfaces import ILink, ILinkManager
from cybertools.wiki.interfaces import ILinkProcessor
+@implementer(ILinkProcessor)
class LinkProcessor(object):
""" Abstract base class. """
- implements(ILinkProcessor)
-
source = request = None
targetName = ''
diff --git a/cybertools/wiki/base/media.py b/cybertools/wiki/base/media.py
index f7405fb..f1149cd 100644
--- a/cybertools/wiki/base/media.py
+++ b/cybertools/wiki/base/media.py
@@ -1,37 +1,18 @@
-#
-# 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.wiki.base.media
-"""
-Basic (sample) implementation for a wiki media manager and media objects.
-
-$Id$
+""" Basic (sample) implementation for a wiki media manager and media objects.
"""
from zope.component import adapts
-from zope.interface import implements
+from zope.interface import implementer
from zope.traversing.browser import absoluteURL
from cybertools.wiki.interfaces import IWiki, IMediaManager, IMediaObject
+@implementer(IMediaManager)
class WikiMediaManager(object):
""" A Wiki adapter for providing media manager functionality. """
- implements(IMediaManager)
adapts(IWiki)
name = '.media'
@@ -62,11 +43,10 @@ class WikiMediaManager(object):
return self.objects.values()
+@implementer(IMediaObject)
class MediaObject(object):
""" A basic (maybe persistent) media object. """
- implements(IMediaObject)
-
data = None
def __init__(self, name, title=None, parent=None):
diff --git a/cybertools/wiki/base/wiki.py b/cybertools/wiki/base/wiki.py
index c36af34..bdbf21a 100644
--- a/cybertools/wiki/base/wiki.py
+++ b/cybertools/wiki/base/wiki.py
@@ -1,29 +1,10 @@
-#
-# 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.wiki.base.wiki
-"""
-A Wiki manager managing wikis and wiki-related objects, esp plugins.
-
-$Id$
+""" A Wiki manager managing wikis and wiki-related objects, esp plugins.
"""
from zope import component
-from zope.interface import implements
+from zope.interface import implementer
from zope.intid.interfaces import IIntIds
from zope.traversing.browser import absoluteURL
@@ -35,10 +16,9 @@ from cybertools.wiki.interfaces import IParser, IWriter
from cybertools.wiki.base.config import BaseConfiguration
+@implementer(IWikiManager)
class WikiManager(BaseConfiguration):
- implements(IWikiManager)
-
def __init__(self):
self.setup()
@@ -91,7 +71,7 @@ class WikiManager(BaseConfiguration):
return obj
def resolveUid(self, uid):
- if isinstance(uid, basestring):
+ if isinstance(uid, str):
if ':' in uid:
protocol, address = uid.split(':', 1)
if protocol.lower() in protocols:
@@ -106,10 +86,9 @@ class WikiManager(BaseConfiguration):
return component.getUtility(IWikiConfiguration)
+@implementer(IWiki)
class Wiki(BaseConfiguration):
- implements(IWiki)
-
manager = None
def __init__(self, name, title=None):
@@ -164,10 +143,9 @@ class Wiki(BaseConfiguration):
return self.getManager()
+@implementer(IWikiPage)
class WikiPage(BaseConfiguration):
- implements(IWikiPage)
-
wiki = None
text = u''
diff --git a/cybertools/wiki/common.py b/cybertools/wiki/common.py
index aca311f..7b23e06 100644
--- a/cybertools/wiki/common.py
+++ b/cybertools/wiki/common.py
@@ -1,28 +1,9 @@
-#
-# 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.wiki.common
-"""
-Common basic generic stuff.
-
-$Id$
+""" Common basic generic stuff.
"""
-from zope.interface import implements
+from zope.interface import implementer
from cybertools.wiki.interfaces import IWebResource
@@ -31,10 +12,9 @@ protocols = set(['dav', 'file', 'ftp', 'http', 'https', 'javascript',
'mailto', 'sftp', 'smb'])
+@implementer(IWebResource)
class ExternalPage(object):
- implements(IWebResource)
-
def __init__(self, uid):
self.uid = uid
diff --git a/cybertools/wiki/dcu/html.py b/cybertools/wiki/dcu/html.py
index 9b88721..efeee4e 100644
--- a/cybertools/wiki/dcu/html.py
+++ b/cybertools/wiki/dcu/html.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.wiki.dcu.html
-"""
-A writer implementation based on the docutils HTML writer.
-
-$Id$
+""" A writer implementation based on the docutils HTML writer.
"""
from docutils.core import publish_from_doctree
from docutils import nodes
from docutils.writers.html4css1 import HTMLTranslator, Writer as HTMLWriter
from zope import component
-from zope.interface import implements
+from zope.interface import implementer
from cybertools.wiki.interfaces import INodeProcessor, IWriter
@@ -39,10 +20,9 @@ class HTMLWriter(HTMLWriter):
return template % subs
+@implementer(IWriter)
class Writer(object):
- implements(IWriter)
-
def __init__(self):
self.writer = HTMLWriter()
self.writer.translator_class = BodyTranslator
diff --git a/cybertools/wiki/dcu/process.py b/cybertools/wiki/dcu/process.py
index 89bb74a..3ba38a0 100644
--- a/cybertools/wiki/dcu/process.py
+++ b/cybertools/wiki/dcu/process.py
@@ -1,32 +1,12 @@
-#
-# 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.wiki.dcu.process
-"""
-Node processor implementations for docutils nodes.
-
-$Id: process.py 3153 2009-01-17 16:51:09Z helmutm $
+""" Node processor implementations for docutils nodes.
"""
from docutils.nodes import Text
from zope import component
from zope.cachedescriptors.property import Lazy
from zope.component import adapts
-from zope.interface import implements
from cybertools.wiki.base.link import LinkProcessor
from cybertools.wiki.dcu.html import HTMLImageNode, HTMLReferenceNode
diff --git a/cybertools/wiki/dcu/rstx.py b/cybertools/wiki/dcu/rstx.py
index 56da1c8..f842183 100644
--- a/cybertools/wiki/dcu/rstx.py
+++ b/cybertools/wiki/dcu/rstx.py
@@ -1,37 +1,17 @@
-#
-# 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.wiki.dcu.rstx
-"""
-A parser implementation based on the docutils restructured text parser.
-
-$Id$
+""" A parser implementation based on the docutils restructured text parser.
"""
from docutils.core import publish_doctree
-from zope.interface import implements
+from zope.interface import implementer
from cybertools.wiki.interfaces import IParser
+@implementer(IParser)
class Parser(object):
- implements(IParser)
-
def parse(self, text, context=None, request=None):
tree = publish_doctree(text)
tree.context = context
diff --git a/cybertools/wiki/generic/adapter.py b/cybertools/wiki/generic/adapter.py
index ab3c022..0f863fc 100644
--- a/cybertools/wiki/generic/adapter.py
+++ b/cybertools/wiki/generic/adapter.py
@@ -1,25 +1,6 @@
-#
-# 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
-#
+# cybertools.wiki.generic.adapter
-"""
-Wiki implementation = adapters for Zope2 content objects.
-
-$Id$
+""" Wiki implementation = adapters for Zope2 content objects.
"""
try:
@@ -32,7 +13,7 @@ from persistent.mapping import PersistentMapping
from zope.cachedescriptors.property import Lazy
from zope import component
from zope.component import adapts
-from zope.interface import implements
+from zope.interface import implementer
from zope.intid import IntIds
from zope.intid.interfaces import IIntIds
@@ -45,10 +26,9 @@ from cybertools.wiki.base.wiki import WikiPage as BaseWikiPage
from cybertools.wiki.interfaces import ILinkManager, IWikiConfigInfo
+@implementer(IWikiConfigInfo)
class PersistentConfigInfo(PersistentMapping):
- implements(IWikiConfigInfo)
-
def set(self, functionality, value):
self[functionality] = value
diff --git a/cybertools/wiki/preproc/README.txt b/cybertools/wiki/preproc/README.txt
index d973a04..6c5ba48 100644
--- a/cybertools/wiki/preproc/README.txt
+++ b/cybertools/wiki/preproc/README.txt
@@ -2,8 +2,6 @@
Standard Wiki Pre-processors
============================
- ($Id$)
-
MediaWiki Formatting
====================
@@ -24,6 +22,6 @@ Embedding of Images
>>> src = '''[[image:media01.jpg]]'''
- >>> print preprocess(src)
+ >>> print(preprocess(src))
.. image:: media01.jpg
diff --git a/cybertools/wiki/tests.py b/cybertools/wiki/tests.py
index 0633658..27a9ada 100755
--- a/cybertools/wiki/tests.py
+++ b/cybertools/wiki/tests.py
@@ -1,14 +1,11 @@
-#! /usr/bin/python
+# cybertools.wiki.tests
-"""
-Tests for the 'cybertools.wiki' package.
-
-$Id$
+""" Tests for the 'cybertools.wiki' package.
"""
import unittest, doctest
from zope import component
-from zope.interface import implements
+from zope.interface import implementer
from zope.intid.interfaces import IIntIds
from zope.publisher.interfaces.browser import IBrowserRequest
from zope.traversing.browser.interfaces import IAbsoluteURL
@@ -25,10 +22,9 @@ from cybertools.wiki.interfaces import IWiki, IWikiPage, IMediaObject
#from cybertools.wiki.tracking import link
+@implementer(IAbsoluteURL)
class WikiURL(object):
- implements(IAbsoluteURL)
-
def __init__(self, context, request):
self.context = context
self.request = request
diff --git a/cybertools/xedit/browser.py b/cybertools/xedit/browser.py
index 00acae7..c92e220 100644
--- a/cybertools/xedit/browser.py
+++ b/cybertools/xedit/browser.py
@@ -1,25 +1,6 @@
-#
-# 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
-#
+# cybertools.xedit.browser
-"""
-(View) class(es) for the external editor functionality.
-
-$Id$
+""" (View) class(es) for the external editor functionality.
"""
from zope.app.pagetemplate import ViewPageTemplateFile
@@ -49,7 +30,7 @@ class ExternalEditorView(object):
r.append('title:' + fromUnicode(context.title))
auth = self.request.get('_auth')
if auth:
- print 'ExternalEditorView: auth = ', auth
+ print('ExternalEditorView: auth = ', auth)
if auth.endswith('\n'):
auth = auth[:-1]
r.append('auth:' + auth)
diff --git a/pyproject.toml b/pyproject.toml
index aba2c01..74d3b02 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -14,6 +14,7 @@ authors = [{name = "Helmut Merz", email = "helmutm@cy55.de"}]
dependencies = [
"bs4",
"BTrees",
+ "docutils",
"lxml",
"persistent",
"pillow",