Skip to content

Commit

Permalink
Drop support for historical versions which no longer exist since Zope…
Browse files Browse the repository at this point in the history
… 4.0a2.

This is needed to run with Zope > 4.0b5.
  • Loading branch information
Michael Howitz committed Oct 3, 2018
1 parent 418a27e commit 86fe0b8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 14 deletions.
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ Changelog
- Update HTML code of ZMI for Bootstrap ZMI.
(`#16 <https://github.com/zopefoundation/Products.PythonScripts/pull/16>`_)

- Drop support for historical versions which no longer exist since Zope 4.0a2.


4.1 (2017-06-19)
----------------
Expand Down
16 changes: 3 additions & 13 deletions src/Products/PythonScripts/PythonScript.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@
from App.Dialogs import MessageDialog
from App.special_dtml import DTMLFile
from OFS.Cache import Cacheable
from OFS.History import Historical
from OFS.History import html_diff
from OFS.SimpleItem import SimpleItem
from RestrictedPython import compile_restricted_function
from Shared.DC.Scripts.Script import BindingsUI
Expand Down Expand Up @@ -97,7 +95,7 @@ def manage_addPythonScript(self, id, REQUEST=None, submit=None):
return ''


class PythonScript(Script, Historical, Cacheable):
class PythonScript(Script, Cacheable):
"""Web-callable scripts written in a safe subset of Python.
The function may include standard python code, so long as it does
Expand All @@ -117,7 +115,7 @@ class PythonScript(Script, Historical, Cacheable):
) + BindingsUI.manage_options + (
{'label': 'Test', 'action': 'ZScriptHTML_tryForm'},
{'label': 'Proxy', 'action': 'manage_proxyForm'},
) + Historical.manage_options + SimpleItem.manage_options + \
) + SimpleItem.manage_options + \
Cacheable.manage_options

def __init__(self, id):
Expand Down Expand Up @@ -196,12 +194,6 @@ def ZScriptHTML_tryParams(self):
param_names.append(name.split('=', 1)[0].strip())
return param_names

def manage_historyCompare(self, rev1, rev2, REQUEST,
historyComparisonResults=''):
return PythonScript.inheritedAttribute('manage_historyCompare')(
self, rev1, rev2, REQUEST,
historyComparisonResults=html_diff(rev1.read(), rev2.read()))

def __setstate__(self, state):
Script.__setstate__(self, state)
if (getattr(self, 'Python_magic', None) != Python_magic or
Expand Down Expand Up @@ -390,9 +382,7 @@ def manage_proxy(self, roles=(), REQUEST=None):

security.declareProtected(
'Change Python Scripts',
'PUT', 'manage_FTPput', 'write',
'manage_historyCopy',
'manage_beforeHistoryCopy', 'manage_afterHistoryCopy')
'PUT', 'manage_FTPput', 'write')

def PUT(self, REQUEST, RESPONSE):
""" Handle HTTP PUT requests """
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ commands =
coverage combine
coverage html
coverage xml
coverage report --fail-under=71
coverage report --fail-under=72

[testenv:flake8]
basepython = python3.6
Expand Down

0 comments on commit 86fe0b8

Please sign in to comment.