Skip to content

Commit

Permalink
Add compatibility with webdav changes in Zope 4.0a2.
Browse files Browse the repository at this point in the history
  • Loading branch information
hannosch committed Aug 6, 2016
1 parent dc0ca64 commit 049d810
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 8 deletions.
5 changes: 3 additions & 2 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
Changelog
=========

3.0.1 (unreleased)
------------------
4.0 (unreleased)
----------------

- Add compatibility with webdav changes in Zope 4.0a2.

3.0 (2016-07-18)
----------------
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from setuptools import setup, find_packages

setup(name='Products.PythonScripts',
version='3.0.1.dev0',
version='4.0.dev0',
url='http://pypi.python.org/pypi/Products.PythonScripts',
license='ZPL 2.1',
description="Provides support for restricted execution of Python "
Expand Down Expand Up @@ -46,7 +46,7 @@
'DocumentTemplate',
'RestrictedPython',
'zExceptions',
'Zope2 >= 2.13.0a1',
'Zope2 >= 4.0a1',
],
include_package_data=True,
zip_safe=False,
Expand Down
6 changes: 5 additions & 1 deletion src/Products/PythonScripts/PythonScript.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,13 @@
from Shared.DC.Scripts.Script import BindingsUI
from Shared.DC.Scripts.Script import defaultBindings
from Shared.DC.Scripts.Script import Script
from webdav.Lockable import ResourceLockedError
from zExceptions import Forbidden

try:
from zExceptions import ResourceLockedError
except ImportError:
from webdav.Lockable import ResourceLockedError

LOG = getLogger('PythonScripts')

# Track the Python bytecode version
Expand Down
5 changes: 4 additions & 1 deletion src/Products/PythonScripts/tests/testPythonScript.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,5 +330,8 @@ class PythonScriptInterfaceConformanceTests(unittest.TestCase):

def test_class_conforms_to_IWriteLock(self):
from zope.interface.verify import verifyClass
from webdav.interfaces import IWriteLock
try:
from OFS.interfaces import IWriteLock
except ImportError:
from webdav.interfaces import IWriteLock
verifyClass(IWriteLock, PythonScript)
4 changes: 2 additions & 2 deletions src/Products/PythonScripts/www/pyScriptEdit.dtml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
<td align="left" valign="top" colspan="2">
<div class="form-element">
<dtml-if wl_isLocked>
<em>Locked by WebDAV</em>
<em>Locked</em>
<dtml-else>
<input class="form-element" type="submit"
name="ZPythonScriptHTML_editAction:method" value="Save Changes">
Expand Down Expand Up @@ -142,7 +142,7 @@ to <a href="document_src">view or download</a> the current source.
<td align="left" valign="top">
<div class="form-element">
<dtml-if wl_isLocked>
<em>Locked by WebDAV</em>
<em>Locked</em>
<dtml-else>
<input class="form-element" type="submit" value="Upload File">
</dtml-if>
Expand Down

0 comments on commit 049d810

Please sign in to comment.