Skip to content

Commit

Permalink
[fc] Repository: plone.app.viewletmanager
Browse files Browse the repository at this point in the history
Branch: refs/heads/master
Date: 2015-03-04T17:02:19+01:00
Author: Gil Forcada (gforcada) <gforcada@gnome.org>
Commit: plone/plone.app.viewletmanager@202f845

Sort viewlets on export

Fixes: plone/plone.app.viewletmanager#7

Files changed:
M plone/app/viewletmanager/exportimport/storage.py
M plone/app/viewletmanager/tests/test_exportimport.py

diff --git a/plone/app/viewletmanager/exportimport/storage.py b/plone/app/viewletmanager/exportimport/storage.py
index 3e0b500..22c1d2f 100644
--- a/plone/app/viewletmanager/exportimport/storage.py
+++ b/plone/app/viewletmanager/exportimport/storage.py
@@ -123,8 +123,8 @@ def _exportNode(self):
         output = self._doc.createElement('object')
         for nodename in ('order', 'hidden'):
             skins = getattr(self.context, '_'+nodename)
-            for skin in skins:
-                for name in skins[skin]:
+            for skin in sorted(skins):
+                for name in sorted(skins[skin]):
                     node = self._doc.createElement(nodename)
                     node.setAttribute('skinname', skin)
                     node.setAttribute('manager', name)
diff --git a/plone/app/viewletmanager/tests/test_exportimport.py b/plone/app/viewletmanager/tests/test_exportimport.py
index 8839c06..d9db226 100644
--- a/plone/app/viewletmanager/tests/test_exportimport.py
+++ b/plone/app/viewletmanager/tests/test_exportimport.py
@@ -42,14 +42,14 @@
 _VIEWLETS_XML = """\
 <?xml version="1.0"?>
 <object>
+ <order manager="top" skinname="basic">
+  <viewlet name="one"/>
+ </order>
  <order manager="top" skinname="fancy">
   <viewlet name="two"/>
   <viewlet name="three"/>
   <viewlet name="one"/>
  </order>
- <order manager="top" skinname="basic">
-  <viewlet name="one"/>
- </order>
  <hidden manager="top" skinname="light">
   <viewlet name="two"/>
  </hidden>
@@ -353,11 +353,11 @@ def test_normal(self):
         context._files['viewlets.xml'] = self._VIEWLETS_XML
         importViewletSettingsStorage(context)
 
-        self.assertEqual(utility.getOrder('top', 'fancy'),
-                         ('two', 'three', 'one'))
+        self.assertEqual(utility.getOrder('top', 'basic'), ('one', ))
         self.assertEqual(utility.getOrder('top', 'undefined (fallback)'),
+                         ('one', ))
+        self.assertEqual(utility.getOrder('top', 'fancy'),
                          ('two', 'three', 'one'))
-        self.assertEqual(utility.getOrder('top', 'basic'), ('one', ))
         self.assertEqual(utility.getHidden('top', 'light'), ('two', ))
 
     def test_fragment_skip_purge(self):


Repository: plone.app.viewletmanager
Branch: refs/heads/master
Date: 2015-03-05T15:13:06-08:00
Author: David Glick (davisagli) <david.glick@plone.org>
Commit: plone/plone.app.viewletmanager@41dfe3c

Merge pull request #8 from derFreitag/master

Sort viewlets on export

Files changed:
M plone/app/viewletmanager/exportimport/storage.py
M plone/app/viewletmanager/tests/test_exportimport.py

diff --git a/plone/app/viewletmanager/exportimport/storage.py b/plone/app/viewletmanager/exportimport/storage.py
index 3e0b500..22c1d2f 100644
--- a/plone/app/viewletmanager/exportimport/storage.py
+++ b/plone/app/viewletmanager/exportimport/storage.py
@@ -123,8 +123,8 @@ def _exportNode(self):
         output = self._doc.createElement('object')
         for nodename in ('order', 'hidden'):
             skins = getattr(self.context, '_'+nodename)
-            for skin in skins:
-                for name in skins[skin]:
+            for skin in sorted(skins):
+                for name in sorted(skins[skin]):
                     node = self._doc.createElement(nodename)
                     node.setAttribute('skinname', skin)
                     node.setAttribute('manager', name)
diff --git a/plone/app/viewletmanager/tests/test_exportimport.py b/plone/app/viewletmanager/tests/test_exportimport.py
index 8839c06..d9db226 100644
--- a/plone/app/viewletmanager/tests/test_exportimport.py
+++ b/plone/app/viewletmanager/tests/test_exportimport.py
@@ -42,14 +42,14 @@
 _VIEWLETS_XML = """\
 <?xml version="1.0"?>
 <object>
+ <order manager="top" skinname="basic">
+  <viewlet name="one"/>
+ </order>
  <order manager="top" skinname="fancy">
   <viewlet name="two"/>
   <viewlet name="three"/>
   <viewlet name="one"/>
  </order>
- <order manager="top" skinname="basic">
-  <viewlet name="one"/>
- </order>
  <hidden manager="top" skinname="light">
   <viewlet name="two"/>
  </hidden>
@@ -353,11 +353,11 @@ def test_normal(self):
         context._files['viewlets.xml'] = self._VIEWLETS_XML
         importViewletSettingsStorage(context)
 
-        self.assertEqual(utility.getOrder('top', 'fancy'),
-                         ('two', 'three', 'one'))
+        self.assertEqual(utility.getOrder('top', 'basic'), ('one', ))
         self.assertEqual(utility.getOrder('top', 'undefined (fallback)'),
+                         ('one', ))
+        self.assertEqual(utility.getOrder('top', 'fancy'),
                          ('two', 'three', 'one'))
-        self.assertEqual(utility.getOrder('top', 'basic'), ('one', ))
         self.assertEqual(utility.getHidden('top', 'light'), ('two', ))
 
     def test_fragment_skip_purge(self):
  • Loading branch information
davisagli committed Mar 5, 2015
1 parent 0f795a0 commit b72a716
Showing 1 changed file with 126 additions and 35 deletions.
161 changes: 126 additions & 35 deletions last_commit.txt
Original file line number Diff line number Diff line change
@@ -1,45 +1,136 @@
Repository: plone.app.dexterity
Repository: plone.app.viewletmanager
Branch: refs/heads/master
Date: 2015-03-05T21:11:42+01:00
Author: Jens W. Klein (jensens) <jk@kleinundpartner.at>
Commit: https://github.com/plone/plone.app.dexterity/commit/53b7c0f695c90a872455d651948471d22c2ebba2
Date: 2015-03-04T17:02:19+01:00
Author: Gil Forcada (gforcada) <gforcada@gnome.org>
Commit: https://github.com/plone/plone.app.viewletmanager/commit/202f845d0dc25817c1017933d53ed6cba9f6252c

docs: no more updates
Sort viewlets on export

Fixes: https://github.com/plone/plone.app.viewletmanager/issues/7

Files changed:
M README.rst

diff --git a/README.rst b/README.rst
index 78730b9..50ded0e 100644
--- a/README.rst
+++ b/README.rst
@@ -115,26 +115,16 @@ The following documents are not Dexterity-specific, but will likely be useful
to users of Dexterity:

* `Schema-driven forms manual`_
-* `five.grok manual`_

.. _`Schema-driven forms manual`: http://docs.plone.org/develop/addons/schema-driven-forms/index.html
-.. _`five.grok manual`: http://docs.plone.org/develop/addons/five-grok/index.html

M plone/app/viewletmanager/exportimport/storage.py
M plone/app/viewletmanager/tests/test_exportimport.py

diff --git a/plone/app/viewletmanager/exportimport/storage.py b/plone/app/viewletmanager/exportimport/storage.py
index 3e0b500..22c1d2f 100644
--- a/plone/app/viewletmanager/exportimport/storage.py
+++ b/plone/app/viewletmanager/exportimport/storage.py
@@ -123,8 +123,8 @@ def _exportNode(self):
output = self._doc.createElement('object')
for nodename in ('order', 'hidden'):
skins = getattr(self.context, '_'+nodename)
- for skin in skins:
- for name in skins[skin]:
+ for skin in sorted(skins):
+ for name in sorted(skins[skin]):
node = self._doc.createElement(nodename)
node.setAttribute('skinname', skin)
node.setAttribute('manager', name)
diff --git a/plone/app/viewletmanager/tests/test_exportimport.py b/plone/app/viewletmanager/tests/test_exportimport.py
index 8839c06..d9db226 100644
--- a/plone/app/viewletmanager/tests/test_exportimport.py
+++ b/plone/app/viewletmanager/tests/test_exportimport.py
@@ -42,14 +42,14 @@
_VIEWLETS_XML = """\
<?xml version="1.0"?>
<object>
+ <order manager="top" skinname="basic">
+ <viewlet name="one"/>
+ </order>
<order manager="top" skinname="fancy">
<viewlet name="two"/>
<viewlet name="three"/>
<viewlet name="one"/>
</order>
- <order manager="top" skinname="basic">
- <viewlet name="one"/>
- </order>
<hidden manager="top" skinname="light">
<viewlet name="two"/>
</hidden>
@@ -353,11 +353,11 @@ def test_normal(self):
context._files['viewlets.xml'] = self._VIEWLETS_XML
importViewletSettingsStorage(context)

-Mailing list
-============
-
-The `dexterity-development group`_ provides a place to discuss development
-and use of Dexterity.
-
-.. _`dexterity-development group`: http://groups.google.com/group/dexterity-development
-
Issue tracker
=============
- self.assertEqual(utility.getOrder('top', 'fancy'),
- ('two', 'three', 'one'))
+ self.assertEqual(utility.getOrder('top', 'basic'), ('one', ))
self.assertEqual(utility.getOrder('top', 'undefined (fallback)'),
+ ('one', ))
+ self.assertEqual(utility.getOrder('top', 'fancy'),
('two', 'three', 'one'))
- self.assertEqual(utility.getOrder('top', 'basic'), ('one', ))
self.assertEqual(utility.getHidden('top', 'light'), ('two', ))

Please report issues via the `Plone issue tracker`_.
def test_fragment_skip_purge(self):


Repository: plone.app.viewletmanager
Branch: refs/heads/master
Date: 2015-03-05T15:13:06-08:00
Author: David Glick (davisagli) <david.glick@plone.org>
Commit: https://github.com/plone/plone.app.viewletmanager/commit/41dfe3cb77f58b7c899574afe26ef841c43dd20b

Merge pull request #8 from derFreitag/master

Sort viewlets on export

Files changed:
M plone/app/viewletmanager/exportimport/storage.py
M plone/app/viewletmanager/tests/test_exportimport.py

diff --git a/plone/app/viewletmanager/exportimport/storage.py b/plone/app/viewletmanager/exportimport/storage.py
index 3e0b500..22c1d2f 100644
--- a/plone/app/viewletmanager/exportimport/storage.py
+++ b/plone/app/viewletmanager/exportimport/storage.py
@@ -123,8 +123,8 @@ def _exportNode(self):
output = self._doc.createElement('object')
for nodename in ('order', 'hidden'):
skins = getattr(self.context, '_'+nodename)
- for skin in skins:
- for name in skins[skin]:
+ for skin in sorted(skins):
+ for name in sorted(skins[skin]):
node = self._doc.createElement(nodename)
node.setAttribute('skinname', skin)
node.setAttribute('manager', name)
diff --git a/plone/app/viewletmanager/tests/test_exportimport.py b/plone/app/viewletmanager/tests/test_exportimport.py
index 8839c06..d9db226 100644
--- a/plone/app/viewletmanager/tests/test_exportimport.py
+++ b/plone/app/viewletmanager/tests/test_exportimport.py
@@ -42,14 +42,14 @@
_VIEWLETS_XML = """\
<?xml version="1.0"?>
<object>
+ <order manager="top" skinname="basic">
+ <viewlet name="one"/>
+ </order>
<order manager="top" skinname="fancy">
<viewlet name="two"/>
<viewlet name="three"/>
<viewlet name="one"/>
</order>
- <order manager="top" skinname="basic">
- <viewlet name="one"/>
- </order>
<hidden manager="top" skinname="light">
<viewlet name="two"/>
</hidden>
@@ -353,11 +353,11 @@ def test_normal(self):
context._files['viewlets.xml'] = self._VIEWLETS_XML
importViewletSettingsStorage(context)

-.. _`Plone issue tracker`: https://dev.plone.org/
+.. _`Plone issue tracker`: https://github.com/plone/plone.app.dexterity/issues
- self.assertEqual(utility.getOrder('top', 'fancy'),
- ('two', 'three', 'one'))
+ self.assertEqual(utility.getOrder('top', 'basic'), ('one', ))
self.assertEqual(utility.getOrder('top', 'undefined (fallback)'),
+ ('one', ))
+ self.assertEqual(utility.getOrder('top', 'fancy'),
('two', 'three', 'one'))
- self.assertEqual(utility.getOrder('top', 'basic'), ('one', ))
self.assertEqual(utility.getHidden('top', 'light'), ('two', ))

Support
=======
def test_fragment_skip_purge(self):


0 comments on commit b72a716

Please sign in to comment.