1

Having a Plone skin interface registered as follow:

  <interface
      interface=".interfaces.IThemeSpecific"
      type="zope.publisher.interfaces.browser.IBrowserSkinType"
      name="My Theme Name"
      />

What is the simplest way to get the interface (my.app.browser.interfaces.IThemeSpecific) knowing the name ("My Theme Name")?

keul
  • 7,673
  • 20
  • 45

2 Answers2

3

Probably this:

>>> from zope.component import getUtility 
>>> from zope.publisher.interfaces.browser import IBrowserSkinType
>>> getUtility(IBrowserSkinType, name="Old Plone 3 Custom Theme")
<InterfaceClass plonetheme.classic.browser.interfaces.IThemeSpecific>
alepisa
  • 1,324
  • 8
  • 14
0

If you have a buildout where this plone skin is installed, adding the collective.recipe.omelette to it will help you later being able to grep on all your packages for it.

So something like this will work:

grep -R --include=*.zcml 'My Theme Name' parts/omelette
gforcada
  • 2,498
  • 17
  • 26
  • Sorry, you misunderstood my question, that was about getting the name from Plone/Python, in a dynamic way! – keul Jul 15 '14 at 07:34