[Testbot] Plone 5.0 - Python 2.7 - Build # 3048 - Fixed! - 0 failure(s)

jenkins at plone.org jenkins at plone.org
Sun Aug 17 12:14:27 UTC 2014


-------------------------------------------------------------------------------
Plone 5.0 - Python 2.7 - Build # 3048 - Fixed!
-------------------------------------------------------------------------------

http://jenkins.plone.org/job/plone-5.0-python-2.7/3048/


-------------------------------------------------------------------------------
CHANGES
-------------------------------------------------------------------------------

Repository: plone.app.theming
Branch: refs/heads/master
Date: 2014-08-16T20:01:35+02:00
Author: Bo Simonsen (bosim) <bo at geekworld.dk>
Commit: https://github.com/plone/plone.app.theming/commit/80f07f56b39da6ec60333bfe5e0ba3034a387628

Added support for ++theme++current to traverse to the contents of the current activated theme

Files changed:
M src/plone/app/theming/traversal.py

diff --git a/src/plone/app/theming/traversal.py b/src/plone/app/theming/traversal.py
index b9d361d..92cffdd 100644
--- a/src/plone/app/theming/traversal.py
+++ b/src/plone/app/theming/traversal.py
@@ -1,6 +1,14 @@
-from plone.resource.traversal import ResourceTraverser
+import urllib
 
 from plone.app.theming.interfaces import THEME_RESOURCE_NAME
+from plone.registry.interfaces import IRegistry
+from plone.resource.traversal import ResourceTraverser
+from plone.resource.utils import queryResourceDirectory
+
+from zope.component import getUtility
+
+from interfaces import IThemeSettings
+
 
 class ThemeTraverser(ResourceTraverser):
     """The theme traverser.
@@ -10,3 +18,26 @@ class ThemeTraverser(ResourceTraverser):
     """
 
     name = THEME_RESOURCE_NAME
+
+    def __init__(self, context, request=None):
+        self.context = context
+
+    def current_theme(self):
+        registry = getUtility(IRegistry)
+        settings = registry.forInterface(IThemeSettings)
+        return settings.currentTheme
+
+    def traverse(self, name, remaining):
+        type = self.name
+
+        if name == 'current':
+            name = self.current_theme()
+
+        # Note: also fixes possible unicode problems
+        name = urllib.quote(name)
+
+        res = queryResourceDirectory(type, name)
+        if res is not None:
+            return res
+
+        raise NotFound


Repository: plone.app.theming
Branch: refs/heads/master
Date: 2014-08-16T20:28:13+02:00
Author: Bo Simonsen (bosim) <bo at geekworld.dk>
Commit: https://github.com/plone/plone.app.theming/commit/a227d908a5b64e9023137a136b00886f49aaa04d

Added history entry and removed current traversal, using empty string instead.

Files changed:
M docs/HISTORY.rst
M src/plone/app/theming/traversal.py

diff --git a/docs/HISTORY.rst b/docs/HISTORY.rst
index 082527a..002b8bc 100644
--- a/docs/HISTORY.rst
+++ b/docs/HISTORY.rst
@@ -6,11 +6,15 @@ Changelog
 
 - Put themes in a separate zcml file to be able to exclude them
   [laulaz]
-  
-- #14107 bot requests like /widget/oauth_login/info.txt causes 
+
+- #14107 bot requests like /widget/oauth_login/info.txt causes
   problems finding correct context with plone.app.theming
   [anthonygerrard]
 
+- Added support for ++theme++ to traverse to the contents of the
+  current activated theme.
+  [bosim]
+  
 
 1.2.0 (2014-03-02)
 ------------------
diff --git a/src/plone/app/theming/traversal.py b/src/plone/app/theming/traversal.py
index 92cffdd..3db95d2 100644
--- a/src/plone/app/theming/traversal.py
+++ b/src/plone/app/theming/traversal.py
@@ -30,7 +30,7 @@ def current_theme(self):
     def traverse(self, name, remaining):
         type = self.name
 
-        if name == 'current':
+        if name == '':
             name = self.current_theme()
 
         # Note: also fixes possible unicode problems


Repository: plone.app.theming
Branch: refs/heads/master
Date: 2014-08-17T12:53:49+02:00
Author: Jens W. Klein (jensens) <jens at bluedynamics.com>
Commit: https://github.com/plone/plone.app.theming/commit/079d481e76aa67d896e994b58feda06604864b9d

Merge pull request #22 from plone/current-traversal

++theme++current

Files changed:
M docs/HISTORY.rst
M src/plone/app/theming/traversal.py

diff --git a/docs/HISTORY.rst b/docs/HISTORY.rst
index 082527a..002b8bc 100644
--- a/docs/HISTORY.rst
+++ b/docs/HISTORY.rst
@@ -6,11 +6,15 @@ Changelog
 
 - Put themes in a separate zcml file to be able to exclude them
   [laulaz]
-  
-- #14107 bot requests like /widget/oauth_login/info.txt causes 
+
+- #14107 bot requests like /widget/oauth_login/info.txt causes
   problems finding correct context with plone.app.theming
   [anthonygerrard]
 
+- Added support for ++theme++ to traverse to the contents of the
+  current activated theme.
+  [bosim]
+  
 
 1.2.0 (2014-03-02)
 ------------------
diff --git a/src/plone/app/theming/traversal.py b/src/plone/app/theming/traversal.py
index b9d361d..3db95d2 100644
--- a/src/plone/app/theming/traversal.py
+++ b/src/plone/app/theming/traversal.py
@@ -1,6 +1,14 @@
-from plone.resource.traversal import ResourceTraverser
+import urllib
 
 from plone.app.theming.interfaces import THEME_RESOURCE_NAME
+from plone.registry.interfaces import IRegistry
+from plone.resource.traversal import ResourceTraverser
+from plone.resource.utils import queryResourceDirectory
+
+from zope.component import getUtility
+
+from interfaces import IThemeSettings
+
 
 class ThemeTraverser(ResourceTraverser):
     """The theme traverser.
@@ -10,3 +18,26 @@ class ThemeTraverser(ResourceTraverser):
     """
 
     name = THEME_RESOURCE_NAME
+
+    def __init__(self, context, request=None):
+        self.context = context
+
+    def current_theme(self):
+        registry = getUtility(IRegistry)
+        settings = registry.forInterface(IThemeSettings)
+        return settings.currentTheme
+
+    def traverse(self, name, remaining):
+        type = self.name
+
+        if name == '':
+            name = self.current_theme()
+
+        # Note: also fixes possible unicode problems
+        name = urllib.quote(name)
+
+        res = queryResourceDirectory(type, name)
+        if res is not None:
+            return res
+
+        raise NotFound




-------------------------------------------------------------------------------


More information about the Testbot mailing list