Skip to content

Commit

Permalink
[fc] Repository: plone.app.registry
Browse files Browse the repository at this point in the history
Branch: refs/heads/master
Date: 2018-01-25T11:24:31+01:00
Author: Philip Bauer (pbauer) <bauer@starzel.de>
Commit: plone/plone.app.registry@cfd1303

Python 2 / 3 compatible imports

Files changed:
M CHANGES.rst
M plone/app/registry/exportimport/handler.py
M plone/app/registry/tests/test_exportimport.py
Repository: plone.app.registry

Branch: refs/heads/master
Date: 2018-01-27T21:46:28+01:00
Author: Philip Bauer (pbauer) <bauer@starzel.de>
Commit: plone/plone.app.registry@3f437e0

Merge pull request #29 from plone/python3

Python 2 / 3 compatible imports

Files changed:
M CHANGES.rst
M plone/app/registry/exportimport/handler.py
M plone/app/registry/tests/test_exportimport.py
  • Loading branch information
pbauer committed Jan 27, 2018
1 parent 0898aa1 commit 742a98f
Showing 1 changed file with 163 additions and 13 deletions.
176 changes: 163 additions & 13 deletions last_commit.txt
Original file line number Diff line number Diff line change
@@ -1,30 +1,180 @@
Repository: mockup
Repository: plone.app.registry


Branch: refs/heads/master
Date: 2018-01-27T18:04:50+01:00
Author: Johannes Raggam (thet) <thetetet@gmail.com>
Commit: https://github.com/plone/mockup/commit/0f19748a948f1f5139fe99503bc92bbab3646ddd
Date: 2018-01-25T11:24:31+01:00
Author: Philip Bauer (pbauer) <bauer@starzel.de>
Commit: https://github.com/plone/plone.app.registry/commit/cfd1303d8df6f9d06e97bb984d6e2d44aa8dd105

prepare release
Python 2 / 3 compatible imports

Files changed:
M CHANGES.rst
M plone/app/registry/exportimport/handler.py
M plone/app/registry/tests/test_exportimport.py

diff --git a/CHANGES.rst b/CHANGES.rst
index 047ed9ca..72e9637a 100644
index d67644d..f5a616a 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -4,10 +4,6 @@ Changelog
2.6.3 (Unreleased)
------------------
@@ -15,6 +15,9 @@ New features:

-Breaking changes:
Bug fixes:

+- Python 2 / 3 compatible imports.
+ [pbauer]
+
- Minor refactoring of registry import (DRY).
[jensens]

diff --git a/plone/app/registry/exportimport/handler.py b/plone/app/registry/exportimport/handler.py
index 00429f3..9c47bdc 100644
--- a/plone/app/registry/exportimport/handler.py
+++ b/plone/app/registry/exportimport/handler.py
@@ -20,6 +20,9 @@
from zope.dottedname.resolve import resolve
from zope.schema import getFieldNames

+import six
+
+
_marker = object()


@@ -367,7 +370,7 @@ def importRecords(self, node):
continue
elif child.tag.lower() == 'omit':
if child.text:
- omit.append(unicode(child.text))
+ omit.append(six.text_type(child.text))
elif child.tag.lower() == 'value':
values.append(child)

diff --git a/plone/app/registry/tests/test_exportimport.py b/plone/app/registry/tests/test_exportimport.py
index 478e33e..c817341 100644
--- a/plone/app/registry/tests/test_exportimport.py
+++ b/plone/app/registry/tests/test_exportimport.py
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
+from __future__ import print_function
from lxml import etree
from OFS.ObjectManager import ObjectManager
from plone.app.registry import Registry
@@ -73,15 +74,15 @@ def assertXmlEquals(self, expected, actual):
actual_tree = etree.XML(actual)

if etree.tostring(expected_tree) != etree.tostring(actual_tree):
- print
- print "Expected:"
- print prettyXML(expected_tree)
- print
-
-* add items here
- print
- print "Actual:"
- print prettyXML(actual_tree)
- print
+ print()
+ print("Expected:")
+ print(prettyXML(expected_tree))
+ print()
+
+ print()
+ print("Actual:")
+ print(prettyXML(actual_tree))
+ print()

raise AssertionError(u"XML mis-match")



Repository: plone.app.registry


Branch: refs/heads/master
Date: 2018-01-27T21:46:28+01:00
Author: Philip Bauer (pbauer) <bauer@starzel.de>
Commit: https://github.com/plone/plone.app.registry/commit/3f437e02691aef00c90f2e6ddf49bfcd44db077c

Merge pull request #29 from plone/python3

Python 2 / 3 compatible imports

Files changed:
M CHANGES.rst
M plone/app/registry/exportimport/handler.py
M plone/app/registry/tests/test_exportimport.py

diff --git a/CHANGES.rst b/CHANGES.rst
index d67644d..f5a616a 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -15,6 +15,9 @@ New features:

Bug fixes:

+- Python 2 / 3 compatible imports.
+ [pbauer]
+
- Minor refactoring of registry import (DRY).
[jensens]

diff --git a/plone/app/registry/exportimport/handler.py b/plone/app/registry/exportimport/handler.py
index 00429f3..9c47bdc 100644
--- a/plone/app/registry/exportimport/handler.py
+++ b/plone/app/registry/exportimport/handler.py
@@ -20,6 +20,9 @@
from zope.dottedname.resolve import resolve
from zope.schema import getFieldNames

+import six
+
+
_marker = object()


@@ -367,7 +370,7 @@ def importRecords(self, node):
continue
elif child.tag.lower() == 'omit':
if child.text:
- omit.append(unicode(child.text))
+ omit.append(six.text_type(child.text))
elif child.tag.lower() == 'value':
values.append(child)

diff --git a/plone/app/registry/tests/test_exportimport.py b/plone/app/registry/tests/test_exportimport.py
index 478e33e..c817341 100644
--- a/plone/app/registry/tests/test_exportimport.py
+++ b/plone/app/registry/tests/test_exportimport.py
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
+from __future__ import print_function
from lxml import etree
from OFS.ObjectManager import ObjectManager
from plone.app.registry import Registry
@@ -73,15 +74,15 @@ def assertXmlEquals(self, expected, actual):
actual_tree = etree.XML(actual)

if etree.tostring(expected_tree) != etree.tostring(actual_tree):
- print
- print "Expected:"
- print prettyXML(expected_tree)
- print
-
New features:
- print
- print "Actual:"
- print prettyXML(actual_tree)
- print
+ print()
+ print("Expected:")
+ print(prettyXML(expected_tree))
+ print()
+
+ print()
+ print("Actual:")
+ print(prettyXML(actual_tree))
+ print()

raise AssertionError(u"XML mis-match")

- Related Items: Add dropdown with recently added items.


0 comments on commit 742a98f

Please sign in to comment.