Skip to content

Commit

Permalink
[fc] Repository: plone.app.robotframework
Browse files Browse the repository at this point in the history
Branch: refs/heads/master
Date: 2016-02-25T23:57:18+01:00
Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org>
Commit: plone/plone.app.robotframework@117f780

Do not require argparse, decorator, and simplejson in Python 2.7.

Only lower.

Files changed:
M CHANGES.txt
M setup.py
Repository: plone.app.robotframework
Branch: refs/heads/master
Date: 2016-02-26T13:57:52+01:00
Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org>
Commit: plone/plone.app.robotframework@0cfabf9

Merge pull request #53 from plone/cleanup-requires-27

Do not require argparse, decorator, and simplejson in Python 2.7.

Files changed:
M CHANGES.txt
M setup.py
  • Loading branch information
mauritsvanrees committed Feb 26, 2016
1 parent a7afad4 commit e198c62
Showing 1 changed file with 131 additions and 92 deletions.
223 changes: 131 additions & 92 deletions last_commit.txt
Original file line number Diff line number Diff line change
@@ -1,123 +1,162 @@
Repository: plone.contentrules
Repository: plone.app.robotframework


Branch: refs/heads/master
Date: 2016-02-09T23:00:12+01:00
Author: Gil Forcada (gforcada) <gforcada@gnome.org>
Commit: https://github.com/plone/plone.contentrules/commit/dac1655b1f497452e0a92d40f36fc6e12d884989

Fix a write on read situation
Date: 2016-02-25T23:57:18+01:00
Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org>
Commit: https://github.com/plone/plone.app.robotframework/commit/117f780e81a642673a24e67478e792f538e5e10e

If the context gets its first annotation it need to be marked as
safe to write.
Do not require argparse, decorator, and simplejson in Python 2.7.

The same goes for the annotations on the object.
Only lower.

Files changed:
M CHANGES.rst
M plone/contentrules/engine/assignments.py

diff --git a/CHANGES.rst b/CHANGES.rst
index 4b8d987..e2e3c25 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -12,6 +12,8 @@ Fixes:
M CHANGES.txt
M setup.py

diff --git a/CHANGES.txt b/CHANGES.txt
index ba785e2..c5c720a 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -4,9 +4,14 @@ Changelog
0.9.15 (unreleased)
-------------------

- *add item here*
+Fixes:
+
+- Do not require argparse, decorator, and simplejson in Python 2.7,
+ only lower. [maurits]
+
- Replace import of ``zope.testing.testrunner`` with ``zope.testrunner``.
[thet]
-
+

+- CSRF fix: safe write on read.
+ [gforcada]
0.9.14 (2015-10-11)
-------------------
diff --git a/setup.py b/setup.py
index 0bb1daa..b2f7511 100644
--- a/setup.py
+++ b/setup.py
@@ -1,5 +1,6 @@
from setuptools import setup
from setuptools import find_packages
+import sys

2.0.4 (2014-01-27)
------------------
diff --git a/plone/contentrules/engine/assignments.py b/plone/contentrules/engine/assignments.py
index 7918fca..b316a7c 100644
--- a/plone/contentrules/engine/assignments.py
+++ b/plone/contentrules/engine/assignments.py
@@ -16,6 +16,12 @@
version = '0.9.15.dev0'

from BTrees.OOBTree import OOBTree
@@ -43,9 +44,7 @@ def indent(line):
'Products.MailHost',
'Products.PlonePAS',
'Products.PluggableAuthService',
- 'argparse',
'babel',
- 'decorator', # required by r.selenium2library on Python 2.6.x
'five.globalrequest',
'plone.app.testing',
'plone.testing',
@@ -55,7 +54,6 @@ def indent(line):
'robotsuite', # not a direct dependency, but required for convenience
'selenium',
'setuptools',
- 'simplejson', # required for SauceLabs-keywords on Python 2.6.x
'zope.component',
'zope.configuration',
'zope.i18n',
@@ -63,6 +61,13 @@ def indent(line):
'zope.testrunner',
]

+try:
+ from plone.protect.auto import safeWrite
+except ImportError:
+ def safeWrite(*args):
+ pass
+if sys.version_info < (2, 7):
+ install_requires.extend([
+ 'argparse',
+ 'decorator', # required by r.selenium2library on Python 2.6.x
+ 'simplejson', # required for SauceLabs-keywords on Python 2.6.x
+ ])
+

def check_rules_with_dotted_name_moved(rule):
"""Migrate on-the-fly added event dotted name
@@ -85,6 +91,10 @@ def ruleAssignmentManagerAdapterFactory(context):
annotations = IAnnotations(context)
manager = annotations.get(KEY, None)
if manager is None:
- manager = annotations[KEY] = RuleAssignmentManager()
+ annotations[KEY] = RuleAssignmentManager()
+ manager = annotations[KEY]
+ # protect both context and its annotations from a write on read error
+ safeWrite(context)
+ safeWrite(context.__annotations__)

return manager
test_requires = [
'plone.app.dexterity',
'plone.app.textfield',


Repository: plone.contentrules
Repository: plone.app.robotframework


Branch: refs/heads/master
Date: 2016-02-25T13:33:55+01:00
Date: 2016-02-26T13:57:52+01:00
Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org>
Commit: https://github.com/plone/plone.contentrules/commit/5abe5c1c9c36f6a179d82d1dfb96fb3a528d1039
Commit: https://github.com/plone/plone.app.robotframework/commit/0cfabf9b4b18ce52a0463a4511cf3381b13fcd22

Merge pull request #4 from plone/write-on-read
Merge pull request #53 from plone/cleanup-requires-27

Fix a write on read situation
Do not require argparse, decorator, and simplejson in Python 2.7.

Files changed:
M CHANGES.rst
M plone/contentrules/engine/assignments.py

diff --git a/CHANGES.rst b/CHANGES.rst
index 4b8d987..e2e3c25 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -12,6 +12,8 @@ Fixes:
M CHANGES.txt
M setup.py

diff --git a/CHANGES.txt b/CHANGES.txt
index ba785e2..c5c720a 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -4,9 +4,14 @@ Changelog
0.9.15 (unreleased)
-------------------

- *add item here*
+Fixes:
+
+- Do not require argparse, decorator, and simplejson in Python 2.7,
+ only lower. [maurits]
+
- Replace import of ``zope.testing.testrunner`` with ``zope.testrunner``.
[thet]
-
+

+- CSRF fix: safe write on read.
+ [gforcada]
0.9.14 (2015-10-11)
-------------------
diff --git a/setup.py b/setup.py
index 0bb1daa..b2f7511 100644
--- a/setup.py
+++ b/setup.py
@@ -1,5 +1,6 @@
from setuptools import setup
from setuptools import find_packages
+import sys

2.0.4 (2014-01-27)
------------------
diff --git a/plone/contentrules/engine/assignments.py b/plone/contentrules/engine/assignments.py
index 7918fca..b316a7c 100644
--- a/plone/contentrules/engine/assignments.py
+++ b/plone/contentrules/engine/assignments.py
@@ -16,6 +16,12 @@
version = '0.9.15.dev0'

from BTrees.OOBTree import OOBTree
@@ -43,9 +44,7 @@ def indent(line):
'Products.MailHost',
'Products.PlonePAS',
'Products.PluggableAuthService',
- 'argparse',
'babel',
- 'decorator', # required by r.selenium2library on Python 2.6.x
'five.globalrequest',
'plone.app.testing',
'plone.testing',
@@ -55,7 +54,6 @@ def indent(line):
'robotsuite', # not a direct dependency, but required for convenience
'selenium',
'setuptools',
- 'simplejson', # required for SauceLabs-keywords on Python 2.6.x
'zope.component',
'zope.configuration',
'zope.i18n',
@@ -63,6 +61,13 @@ def indent(line):
'zope.testrunner',
]

+try:
+ from plone.protect.auto import safeWrite
+except ImportError:
+ def safeWrite(*args):
+ pass
+if sys.version_info < (2, 7):
+ install_requires.extend([
+ 'argparse',
+ 'decorator', # required by r.selenium2library on Python 2.6.x
+ 'simplejson', # required for SauceLabs-keywords on Python 2.6.x
+ ])
+

def check_rules_with_dotted_name_moved(rule):
"""Migrate on-the-fly added event dotted name
@@ -85,6 +91,10 @@ def ruleAssignmentManagerAdapterFactory(context):
annotations = IAnnotations(context)
manager = annotations.get(KEY, None)
if manager is None:
- manager = annotations[KEY] = RuleAssignmentManager()
+ annotations[KEY] = RuleAssignmentManager()
+ manager = annotations[KEY]
+ # protect both context and its annotations from a write on read error
+ safeWrite(context)
+ safeWrite(context.__annotations__)

return manager
test_requires = [
'plone.app.dexterity',
'plone.app.textfield',


0 comments on commit e198c62

Please sign in to comment.