Skip to content

Commit

Permalink
begin work on py3 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Havlik committed Sep 29, 2016
1 parent 2f708ec commit 24afcfd
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
open('CHANGES.txt').read())

setup(name='zope.app.publisher',
version = '3.10.3dev',
version = '4.0.0.dev',
url='http://pypi.python.org/pypi/zope.app.publisher/',
author='Zope Corporation and Contributors',
author_email='zope-dev@zope.org',
Expand Down
7 changes: 3 additions & 4 deletions src/zope/app/publisher/browser/managementviewselector.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,18 @@
$Id$
"""
from zope.interface import implements
from zope.interface import implementer
from zope.publisher.interfaces.browser import IBrowserPublisher
from zope.publisher.browser import BrowserView
from zope.browsermenu.menu import getFirstMenuItem

@implementer(IBrowserPublisher)
class ManagementViewSelector(BrowserView):
"""View that selects the first available management view.
Support 'zmi_views' actions like: 'javascript:alert("hello")',
Support 'zmi_views' actions like: 'javascript:alert("hello")',
'../view_on_parent.html' or '++rollover++'.
"""
implements(IBrowserPublisher)

def browserDefault(self, request):
return self, ()

Expand Down
9 changes: 4 additions & 5 deletions src/zope/app/publisher/xmlrpc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ class IMethodPublisher(zope.interface.Interface):
"""

# Need to test new __parent__ attribute
@zope.interface.implementer(IMethodPublisher)
class MethodPublisher(XMLRPCView, zope.location.Location):
"""Base class for very simple XML-RPC views that publish methods
This class is meant to be more of an example than a standard base class.
This class is meant to be more of an example than a standard base class.
This example is explained in the README.txt file for this package
"""
zope.interface.implements(IMethodPublisher)

def __getParent(self):
return hasattr(self, '_parent') and self._parent or self.context
Expand All @@ -48,14 +48,13 @@ def __setParent(self, parent):
__parent__ = property(__getParent, __setParent)


@zope.interface.implementer(zope.publisher.interfaces.xmlrpc.IXMLRPCPublisher)
class MethodTraverser(object):
zope.interface.implements(
zope.publisher.interfaces.xmlrpc.IXMLRPCPublisher)

__used_for__ = IMethodPublisher

def __init__(self, context, request):
self.context = context

def publishTraverse(self, request, name):
return getattr(self.context, name)
5 changes: 3 additions & 2 deletions src/zope/app/publisher/xmlrpc/tests/test_directives.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,14 @@
from zope.publisher.interfaces.xmlrpc import IXMLRPCRequest

from zope.app.publisher import xmlrpc
from zope.interface import implements
from zope.interface import implementer


request = Request(IXMLRPCRequest)

@implementer(IC)
class Ob(object):
implements(IC)
pass

ob = Ob()

Expand Down

0 comments on commit 24afcfd

Please sign in to comment.