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

jenkins at plone.org jenkins at plone.org
Tue Aug 19 12:41:35 UTC 2014


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

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


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

Repository: plone.app.theming
Branch: refs/heads/master
Date: 2014-08-19T13:10:49+02:00
Author: Jens W. Klein (jensens) <jk at kleinundpartner.at>
Commit: https://github.com/plone/plone.app.theming/commit/3ec269e51314764afb53620dc915972769cac291

Revert "Merge pull request #13 from plone/acceptance-tests"

This reverts commit e2f58420974538f878ee7c12d98b91dd16caa620, reversing
changes made to 079d481e76aa67d896e994b58feda06604864b9d.

Files changed:
M .travis.yml
M buildout.cfg
M setup.py
M src/plone/app/theming/__init__.py
M src/plone/app/theming/_roman.py
M src/plone/app/theming/browser/controlpanel.py
M src/plone/app/theming/browser/help.py
M src/plone/app/theming/browser/mapper.py
M src/plone/app/theming/exportimport/handler.py
M src/plone/app/theming/header.py
M src/plone/app/theming/interfaces.py
M src/plone/app/theming/plugins/__init__.py
M src/plone/app/theming/plugins/hooks.py
M src/plone/app/theming/plugins/utils.py
M src/plone/app/theming/testing.py
M src/plone/app/theming/tests/test_controlpanel.py
M src/plone/app/theming/tests/test_exportimport.py
M src/plone/app/theming/tests/test_transform.py
M src/plone/app/theming/tests/test_utils.py
M src/plone/app/theming/theme.py
M src/plone/app/theming/transform.py
M src/plone/app/theming/traversal.py
M src/plone/app/theming/upgrade.py
M src/plone/app/theming/utils.py
M travis.cfg
D src/plone/app/theming/tests/acceptance/example.txt
D src/plone/app/theming/tests/acceptance/theme_control_panel.txt
D src/plone/app/theming/tests/acceptance/variables.py
D src/plone/app/theming/tests/test_acceptance.py

diff --git a/.travis.yml b/.travis.yml
index b5f631b..50fb93b 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -7,9 +7,6 @@ before_install:
 install:
   - python bootstrap.py
   - bin/buildout -c travis.cfg -q
-before_script:
-  - "export DISPLAY=:99.0"
-  - "sh -e /etc/init.d/xvfb start"
 script:
   - bin/test -s plone.app.theming
   - bin/test -s plone.app.themingplugins
diff --git a/buildout.cfg b/buildout.cfg
index 4c5afdf..c9b6c24 100644
--- a/buildout.cfg
+++ b/buildout.cfg
@@ -1,6 +1,7 @@
 [buildout]
 extends =
-    http://dist.plone.org/release/4-latest/versions.cfg
+    http://dist.plone.org/release/4.1-latest/versions.cfg
+    http://good-py.appspot.com/release/plone.app.theming/1.0
 parts =
     lxml
     test
diff --git a/setup.py b/setup.py
index 196c1f4..d9b4346 100644
--- a/setup.py
+++ b/setup.py
@@ -42,13 +42,7 @@
           'zope.traversing',
       ],
       extras_require={
-        'test': [
-          'plone.app.testing',
-          'robotsuite',
-          'robotframework-selenium2library',
-          'decorator',
-          'selenium',
-        ],
+        'test': ['plone.app.testing'],
       },
       entry_points="""
       [z3c.autoinclude.plugin]
diff --git a/src/plone/app/theming/__init__.py b/src/plone/app/theming/__init__.py
index 16f050c..d9b386d 100644
--- a/src/plone/app/theming/__init__.py
+++ b/src/plone/app/theming/__init__.py
@@ -1,7 +1,7 @@
 # See http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages
 try:
     __import__('pkg_resources').declare_namespace(__name__)
-except ImportError:  # pragma: no cover
+except ImportError: # pragma: no cover
     from pkgutil import extend_path
     __path__ = extend_path(__path__, __name__)
 
diff --git a/src/plone/app/theming/_roman.py b/src/plone/app/theming/_roman.py
index 4db0f07..ebe0883 100644
--- a/src/plone/app/theming/_roman.py
+++ b/src/plone/app/theming/_roman.py
@@ -16,25 +16,13 @@
 
 import re
 
-# Define exceptions
+#Define exceptions
+class RomanError(Exception): pass
+class OutOfRangeError(RomanError): pass
+class NotIntegerError(RomanError): pass
+class InvalidRomanNumeralError(RomanError): pass
 
-
-class RomanError(Exception):
-    pass
-
-
-class OutOfRangeError(RomanError):
-    pass
-
-
-class NotIntegerError(RomanError):
-    pass
-
-
-class InvalidRomanNumeralError(RomanError):
-    pass
-
-# Define digit mapping
+#Define digit mapping
 romanNumeralMap = (('M',  1000),
                    ('CM', 900),
                    ('D',  500),
@@ -49,13 +37,12 @@ class InvalidRomanNumeralError(RomanError):
                    ('IV', 4),
                    ('I',  1))
 
-
 def toRoman(n):
     """convert integer to Roman numeral"""
     if not (0 < n < 5000):
-        raise OutOfRangeError("number out of range (must be 1..4999)")
-    if int(n) != n:
-        raise NotIntegerError("decimals can not be converted")
+        raise OutOfRangeError, "number out of range (must be 1..4999)"
+    if int(n) <> n:
+        raise NotIntegerError, "decimals can not be converted"
 
     result = ""
     for numeral, integer in romanNumeralMap:
@@ -64,7 +51,7 @@ def toRoman(n):
             n -= integer
     return result
 
-# Define pattern to detect valid Roman numerals
+#Define pattern to detect valid Roman numerals
 romanNumeralPattern = re.compile("""
     ^                   # beginning of string
     M{0,4}              # thousands - 0 to 4 M's
@@ -75,15 +62,14 @@ def toRoman(n):
     (IX|IV|V?I{0,3})    # ones - 9 (IX), 4 (IV), 0-3 (0 to 3 I's),
                         #        or 5-8 (V, followed by 0 to 3 I's)
     $                   # end of string
-    """ , re.VERBOSE)
-
+    """ ,re.VERBOSE)
 
 def fromRoman(s):
     """convert Roman numeral to integer"""
     if not s:
-        raise InvalidRomanNumeralError('Input can not be blank')
+        raise InvalidRomanNumeralError, 'Input can not be blank'
     if not romanNumeralPattern.search(s):
-        raise InvalidRomanNumeralError('Invalid Roman numeral: %s' % s)
+        raise InvalidRomanNumeralError, 'Invalid Roman numeral: %s' % s
 
     result = 0
     index = 0
@@ -92,3 +78,4 @@ def fromRoman(s):
             result += integer
             index += len(numeral)
     return result
+
diff --git a/src/plone/app/theming/browser/controlpanel.py b/src/plone/app/theming/browser/controlpanel.py
index 568f64b..9f1fdbf 100644
--- a/src/plone/app/theming/browser/controlpanel.py
+++ b/src/plone/app/theming/browser/controlpanel.py
@@ -52,17 +52,14 @@ def __call__(self):
         return ''
 
     def _setup(self):
-        self.settings = getUtility(
-            IRegistry).forInterface(IThemeSettings, False)
+        self.settings = getUtility(IRegistry).forInterface(IThemeSettings, False)
         self.zodbThemes = getZODBThemes()
         self.availableThemes = getAvailableThemes()
-        self.selectedTheme = self.getSelectedTheme(
-            self.availableThemes, self.settings.rules)
+        self.selectedTheme = self.getSelectedTheme(self.availableThemes, self.settings.rules)
         self.overlay = ''
 
         self.skinsSettings = ISkinsSchema(self.context)
-        self.skinsVocabulary = getUtility(
-            IVocabularyFactory, name='plone.app.vocabularies.Skins')(self.context)
+        self.skinsVocabulary = getUtility(IVocabularyFactory, name='plone.app.vocabularies.Skins')(self.context)
 
         # Set response header to make sure control panel is never themed
         self.request.response.setHeader('X-Theme-Disabled', '1')
@@ -90,13 +87,11 @@ def update(self):
             themeSelection = form.get('themeName', None)
 
             if themeSelection:
-                themeData = self.getThemeData(
-                    self.availableThemes, themeSelection)
+                themeData = self.getThemeData(self.availableThemes, themeSelection)
                 applyTheme(themeData)
                 self.settings.enabled = True
 
-            IStatusMessage(self.request).add(_(
-                u"Theme enabled. Note that this control panel page is never themed."))
+            IStatusMessage(self.request).add(_(u"Theme enabled. Note that this control panel page is never themed."))
             self._setup()
             return True
 
@@ -129,14 +124,14 @@ def update(self):
                 try:
                     name, expression = line.split('=', 1)
                     parameterExpressions[str(name.strip())] = \
-                        str(expression.strip())
+                                                    str(expression.strip())
                 except ValueError:
                     self.errors['parameterExpressions'] = \
-                        _('error_invalid_parameter_expressions',
-                          default=u"Please ensure you enter one "
-                          u"expression per line, in the "
-                          u"format <name> = <expression>."
-                          )
+                                    _('error_invalid_parameter_expressions',
+                        default=u"Please ensure you enter one "
+                                u"expression per line, in the "
+                                u"format <name> = <expression>."
+                    )
 
             themeBase = form.get('themeBase', None)
             markSpecialLinks = form.get('markSpecialLinks', None)
@@ -170,15 +165,13 @@ def update(self):
                 if usePopups is not None:
                     self.skinsSettings.use_popups = usePopups
                 if iconVisibility is not None:
-                    self.skinsSettings.icon_visibility = iconVisibility.encode(
-                        'utf-8')
+                    self.skinsSettings.icon_visibility = iconVisibility.encode('utf-8')
 
                 IStatusMessage(self.request).add(_(u"Changes saved"))
                 self._setup()
                 return True
             else:
-                IStatusMessage(self.request).add(
-                    _(u"There were errors"), 'error')
+                IStatusMessage(self.request).add(_(u"There were errors"), 'error')
                 self.redirectToFieldset('advanced')
                 return False
 
@@ -197,8 +190,8 @@ def update(self):
             except (zipfile.BadZipfile, zipfile.LargeZipFile,):
                 logger.exception("Could not read zip file")
                 self.errors['themeArchive'] = _('error_invalid_zip',
-                                                default=u"The uploaded file is not a valid Zip archive"
-                                                )
+                        default=u"The uploaded file is not a valid Zip archive"
+                    )
 
             if themeZip:
 
@@ -207,9 +200,9 @@ def update(self):
                 except (ValueError, KeyError,), e:
                     logger.warn(str(e))
                     self.errors['themeArchive'] = _('error_no_rules_file',
-                                                    u"The uploaded file does not contain "
-                                                    u"a valid theme archive."
-                                                    )
+                            u"The uploaded file does not contain "
+                            u"a valid theme archive."
+                        )
                 else:
 
                     themeContainer = getOrCreatePersistentResourceDirectory()
@@ -222,7 +215,7 @@ def update(self):
                                     u"This theme is already installed. "
                                     u"Select 'Replace existing theme' "
                                     u"and re-upload to replace it."
-                                  )
+                                )
                         else:
                             del themeContainer[themeData.__name__]
                             performImport = True
@@ -232,23 +225,20 @@ def update(self):
             if performImport:
                 themeContainer.importZip(themeZip)
 
-                themeDirectory = queryResourceDirectory(
-                    THEME_RESOURCE_NAME, themeData.__name__)
+                themeDirectory = queryResourceDirectory(THEME_RESOURCE_NAME, themeData.__name__)
                 if themeDirectory is not None:
 
                     # If we don't have a rules file, use the template
                     if themeData.rules == u"/++%s++%s/%s" % (THEME_RESOURCE_NAME, themeData.__name__, RULE_FILENAME,):
                         if not themeDirectory.isFile(RULE_FILENAME):
-                            templateThemeDirectory = queryResourceDirectory(
-                                THEME_RESOURCE_NAME, TEMPLATE_THEME)
-                            themeDirectory.writeFile(
-                                RULE_FILENAME, templateThemeDirectory.readFile(RULE_FILENAME))
+                            templateThemeDirectory = queryResourceDirectory(THEME_RESOURCE_NAME, TEMPLATE_THEME)
+                            themeDirectory.writeFile(RULE_FILENAME, templateThemeDirectory.readFile(RULE_FILENAME))
 
                             if not themeDirectory.isFile(DEFAULT_THEME_FILENAME):
                                 IStatusMessage(self.request).add(
-                                    _(u"A boilerplate rules.xml was added to your theme, but no index.html file found. Update rules.xml to reference the current theme file."),
-                                    'warning',
-                                )
+                                        _(u"A boilerplate rules.xml was added to your theme, but no index.html file found. Update rules.xml to reference the current theme file."),
+                                        'warning',
+                                    )
 
                     plugins = getPlugins()
                     pluginSettings = getPluginSettings(themeDirectory, plugins)
@@ -267,12 +257,12 @@ def update(self):
                 self.redirect(
                     "%s/++theme++%s/@@theming-controlpanel-mapper" % (
                         portalUrl, themeData.__name__,)
-                )
+                    )
                 return False
             else:
                 IStatusMessage(self.request).add(
-                    _(u"There were errors"), "error"
-                )
+                        _(u"There were errors"), "error"
+                    )
 
                 self.renderOverlay('upload')
                 return True
@@ -288,8 +278,7 @@ def update(self):
             if not title:
                 self.errors['title'] = _(u"Title is required")
 
-                IStatusMessage(self.request).add(
-                    _(u"There were errors"), 'error')
+                IStatusMessage(self.request).add(_(u"There were errors"), 'error')
 
                 self.renderOverlay('new-theme')
                 return True
@@ -307,7 +296,7 @@ def update(self):
                 self.redirect(
                     "%s/++theme++%s/@@theming-controlpanel-mapper" % (
                         portalUrl, name,)
-                )
+                    )
                 return False
 
         if 'form.button.DeleteSelected' in form:
@@ -351,8 +340,7 @@ def themeList(self):
 
             previewUrl = "++resource++plone.app.theming/defaultPreview.png"
             if theme.preview:
-                previewUrl = "++theme++%s/%s" % (
-                    theme.__name__, theme.preview,)
+                previewUrl = "++theme++%s/%s" % (theme.__name__, theme.preview,)
 
             themes.append({
                 'name': theme.__name__,
@@ -376,4 +364,4 @@ def renderOverlay(self, overlay):
         self.overlay = overlay
 
     def authorize(self):
-        return authorize(self.context, self.request)
+        return authorize(self.context, self.request)
\ No newline at end of file
diff --git a/src/plone/app/theming/browser/help.py b/src/plone/app/theming/browser/help.py
index 91b0682..282cf79 100644
--- a/src/plone/app/theming/browser/help.py
+++ b/src/plone/app/theming/browser/help.py
@@ -6,8 +6,6 @@
 class Help(BrowserView):
 
     def __call__(self):
-        rstSource = pkg_resources.resource_string(
-            'plone.app.theming.browser', 'resources/userguide.rst')
-        parts = docutils.core.publish_parts(
-            source=rstSource, writer_name='html')
+        rstSource = pkg_resources.resource_string('plone.app.theming.browser', 'resources/userguide.rst')
+        parts = docutils.core.publish_parts(source=rstSource, writer_name='html')
         return parts['body_pre_docinfo'] + parts['fragment']
diff --git a/src/plone/app/theming/browser/mapper.py b/src/plone/app/theming/browser/mapper.py
index 9d72a0c..be0bf7b 100644
--- a/src/plone/app/theming/browser/mapper.py
+++ b/src/plone/app/theming/browser/mapper.py
@@ -71,8 +71,7 @@ def setup(self):
         self.themeBasePathEncoded = urllib.quote_plus(self.themeBasePath)
         self.themeBaseUrl = "%s/%s" % (self.portalUrl, self.themeBasePath,)
 
-        self.editable = IWritableResourceDirectory.providedBy(
-            self.resourceDirectory)
+        self.editable = IWritableResourceDirectory.providedBy(self.resourceDirectory)
 
         settings = getUtility(IRegistry).forInterface(IThemeSettings, False)
         self.active = (settings.enabled and self.name == getCurrentTheme())
@@ -80,12 +79,12 @@ def setup(self):
         self.rulesFileName = RULE_FILENAME
 
         self.jsVariables = "var CURRENT_SELECTION='%s'; var THEME_BASE_URL='%s'; var THEME_BASE_PATH_ENCODED='%s'; var EDITABLE=%s; var RULE_FILENAME='%s';" % (
-            self.request.get('file-selector') or '',
-            self.themeBaseUrl,
-            self.themeBasePathEncoded,
-            str(self.editable).lower(),
-            self.rulesFileName
-        )
+                self.request.get('file-selector') or '',
+                self.themeBaseUrl,
+                self.themeBasePathEncoded,
+                str(self.editable).lower(),
+                self.rulesFileName
+            )
 
     def update(self):
         self.themeFiles = self.findThemeFiles(self.resourceDirectory)
@@ -105,15 +104,13 @@ def update(self):
         return True
 
     def authorize(self):
-        authenticator = getMultiAdapter((
-            self.context, self.request), name=u"authenticator")
+        authenticator = getMultiAdapter((self.context, self.request), name=u"authenticator")
         if not authenticator.verify():
             raise Unauthorized
 
     def redirect(self, message):
         IStatusMessage(self.request).add(message)
-        self.request.response.redirect(
-            "%s/@@theming-controlpanel" % self.portalUrl)
+        self.request.response.redirect("%s/@@theming-controlpanel" % self.portalUrl)
 
     def findThemeFiles(self, directory, files=None, prefix=''):
         """Depth-first search of files with known extensions.
@@ -230,18 +227,15 @@ def getFrame(self):
             serializer = getHTMLSerializer([result], pretty_print=False)
 
             try:
-                transform = compileThemeTransform(
-                    themeInfo.rules, themeInfo.absolutePrefix, settings.readNetwork, themeInfo.parameterExpressions or {})
+                transform = compileThemeTransform(themeInfo.rules, themeInfo.absolutePrefix, settings.readNetwork, themeInfo.parameterExpressions or {})
             except lxml.etree.XMLSyntaxError, e:
                 return self.theme_error_template(error=e.msg)
 
-            params = prepareThemeParameters(
-                context, self.request, themeInfo.parameterExpressions or {})
+            params = prepareThemeParameters(context, self.request, themeInfo.parameterExpressions or {})
 
             # Fix url and path since the request gave us this view
             params['url'] = quote_param("%s%s" % (portal_url, path,))
-            params['path'] = quote_param("%s%s" % (
-                portal.absolute_url_path(), path,))
+            params['path'] = quote_param("%s%s" % (portal.absolute_url_path(), path,))
 
             if themeInfo.doctype:
                 serializer.doctype = themeInfo.doctype
@@ -261,8 +255,7 @@ def encodeUrl(orig):
 
                 # relative?
                 if not origUrl.netloc:
-                    newPath = urlparse.urljoin(path.rstrip(
-                        "/") + "/", newPath.lstrip("/"))
+                    newPath = urlparse.urljoin(path.rstrip("/") + "/", newPath.lstrip("/"))
                 elif not orig.lower().startswith(portal_url.lower()):
                     # Not an internal URL - ignore
                     return orig
diff --git a/src/plone/app/theming/exportimport/handler.py b/src/plone/app/theming/exportimport/handler.py
index 18a4f25..22a7577 100644
--- a/src/plone/app/theming/exportimport/handler.py
+++ b/src/plone/app/theming/exportimport/handler.py
@@ -8,7 +8,6 @@
 from plone.app.theming.utils import applyTheme
 from plone.app.theming.utils import getAvailableThemes
 
-
 def importTheme(context):
     """Apply the theme with the id contained in the profile file theme.xml
     and enable the theme.
@@ -53,5 +52,4 @@ def importTheme(context):
             settings.enabled = False
             logger.info('Theme disabled')
         else:
-            raise ValueError(
-                "%s is not a valid value for <enabled />" % themeEnabled)
+            raise ValueError("%s is not a valid value for <enabled />" % themeEnabled)
diff --git a/src/plone/app/theming/header.py b/src/plone/app/theming/header.py
index aede481..1030152 100644
--- a/src/plone/app/theming/header.py
+++ b/src/plone/app/theming/header.py
@@ -1,6 +1,5 @@
 from plone.app.theming.utils import isThemeEnabled
 
-
 def setHeader(object, event):
     """Set a header X-Theme-Enabled in the request if theming is enabled.
 
diff --git a/src/plone/app/theming/interfaces.py b/src/plone/app/theming/interfaces.py
index 15d875f..6f54bf7 100644
--- a/src/plone/app/theming/interfaces.py
+++ b/src/plone/app/theming/interfaces.py
@@ -12,10 +12,9 @@
 TEMPLATE_THEME = 'template'
 
 MANIFEST_FORMAT = ManifestFormat(THEME_RESOURCE_NAME,
-                                 keys=[
-                                 'title', 'description', 'rules', 'prefix', 'doctype', 'preview'],
-                                 parameterSections=['parameters'],
-                                 )
+        keys=['title', 'description', 'rules', 'prefix', 'doctype', 'preview'],
+        parameterSections=['parameters'],
+    )
 
 THEME_EXTENSIONS = frozenset(['html', 'htm'])
 
@@ -25,45 +24,45 @@ class ITheme(Interface):
     """
 
     __name__ = schema.TextLine(
-        title=_(u"Name"),
-    )
+            title=_(u"Name"),
+        )
 
     rules = schema.TextLine(
-        title=_(u"Path to rules"),
-    )
+            title=_(u"Path to rules"),
+        )
 
     title = schema.TextLine(
-        title=_(u"Title"),
-        required=False,
-    )
+            title=_(u"Title"),
+            required=False,
+        )
 
     description = schema.TextLine(
-        title=_(u"Description"),
-        required=False,
-    )
+            title=_(u"Description"),
+            required=False,
+        )
 
     absolutePrefix = schema.TextLine(
-        title=_(u"Absolute prefix"),
-        required=False,
-    )
+            title=_(u"Absolute prefix"),
+            required=False,
+        )
 
     parameterExpressions = schema.Dict(
-        title=_(u"Parameter expressions"),
-        key_type=schema.TextLine(),
-        value_type=schema.TextLine(),
-        required=False,
-    )
+            title=_(u"Parameter expressions"),
+            key_type=schema.TextLine(),
+            value_type=schema.TextLine(),
+            required=False,
+        )
 
     doctype = schema.ASCIILine(
-        title=_(u"Doctype"),
-        required=False,
-        default="",
-    )
+            title=_(u"Doctype"),
+            required=False,
+            default="",
+        )
 
     preview = schema.ASCIILine(
-        title=_(u"Preview image"),
-        required=False,
-    )
+            title=_(u"Preview image"),
+            required=False,
+        )
 
 
 class IThemeSettings(Interface):
@@ -71,88 +70,88 @@ class IThemeSettings(Interface):
     """
 
     enabled = schema.Bool(
-        title=_('enabled', u"Enabled"),
-        description=_('enable_theme_globally',
-                      u"Use this option to enable or disable the theme "
-                      u"globally. Note that the options will also affect "
-                      u"whether the theme is used when this option is "
-                      u'enabled.'),
-        required=True,
-        default=False,
-    )
+            title=_('enabled', u"Enabled"),
+            description=_('enable_theme_globally',
+                          u"Use this option to enable or disable the theme "
+                          u"globally. Note that the options will also affect "
+                          u"whether the theme is used when this option is "
+                          u'enabled.'),
+            required=True,
+            default=False,
+        )
 
     currentTheme = schema.TextLine(
-        title=_('current_theme', u"Current theme"),
-        description=_('current_theme_description',
-                      u"The name of the current theme, i.e. the one "
-                      u"applied most recently."),
-        required=True,
-    )
+            title=_('current_theme', u"Current theme"),
+            description=_('current_theme_description',
+                          u"The name of the current theme, i.e. the one "
+                          u"applied most recently."),
+            required=True,
+        )
 
     rules = schema.TextLine(
-        title=_('rules_file', u"Rules file"),
-        description=_('rules_file_path',
-                      u"File path to the rules file"),
-        required=False,
-    )
+            title=_('rules_file', u"Rules file"),
+            description=_('rules_file_path',
+                          u"File path to the rules file"),
+            required=False,
+        )
 
     absolutePrefix = schema.TextLine(
-        title=_('absolute_url_prefix', u"Absolute URL prefix"),
-        description=_('convert_relative_url',
-                      u"Convert relative URLs in the theme file to absolute paths "
-                      u"using this prefix."),
-        required=False,
-    )
+            title=_('absolute_url_prefix', u"Absolute URL prefix"),
+            description=_('convert_relative_url',
+                 u"Convert relative URLs in the theme file to absolute paths "
+                 u"using this prefix."),
+            required=False,
+        )
 
     readNetwork = schema.Bool(
-        title=_('readNetwork', u"Read network"),
-        description=_('network_urls_allowed',
-                      u"If enabled, network (http, https) urls are "
-                      u"allowed in the rules file and this config."),
-        required=True,
-        default=False,
-    )
+            title=_('readNetwork', u"Read network"),
+            description=_('network_urls_allowed',
+                          u"If enabled, network (http, https) urls are "
+                          u"allowed in the rules file and this config."),
+            required=True,
+            default=False,
+        )
 
     hostnameBlacklist = schema.List(
-        title=_('hostname_blacklist', u"Unthemed host names"),
-        description=_('hostname_blacklist_description',
-                      u"If there are hostnames that you do not want to be themed, "
-                      u"you can list them here. This is useful during theme "
-                      u"development, so that you can compare the themed and unthemed "
-                      u"sites. In some cases, you may also want to provided an "
-                      u"unthemed host alias for content administrators to be able "
-                      u"to use 'plain' Plone."),
-        value_type=schema.TextLine(),
-        required=False,
-        default=[u"127.0.0.1"],
-    )
+            title=_('hostname_blacklist', u"Unthemed host names"),
+            description=_('hostname_blacklist_description',
+                u"If there are hostnames that you do not want to be themed, "
+                u"you can list them here. This is useful during theme "
+                u"development, so that you can compare the themed and unthemed "
+                u"sites. In some cases, you may also want to provided an "
+                u"unthemed host alias for content administrators to be able "
+                u"to use 'plain' Plone."),
+            value_type=schema.TextLine(),
+            required=False,
+            default=[u"127.0.0.1"],
+        )
 
     parameterExpressions = schema.Dict(
-        title=_('parameter_expressions', u"Parameter expressions"),
-        description=_('parameter_expressions_description',
-                      u"You can define parameters here, which will be passed to "
-                      u"the compiled theme. In your rules file, you can refer "
-                      u"to a parameter by $name. Parameters are defined using "
-                      u"TALES expressions, which should evaluate to a string, "
-                      u"a number, a boolean or None. Available variables are "
-                      u"`context`, `request`, `portal`, `portal_state`,  and "
-                      u"`context_state`."),
-        key_type=schema.ASCIILine(),
-        value_type=schema.ASCIILine(),
-        required=False,
-        default={},
-    )
+            title=_('parameter_expressions', u"Parameter expressions"),
+            description=_('parameter_expressions_description',
+                u"You can define parameters here, which will be passed to "
+                u"the compiled theme. In your rules file, you can refer "
+                u"to a parameter by $name. Parameters are defined using "
+                u"TALES expressions, which should evaluate to a string, "
+                u"a number, a boolean or None. Available variables are "
+                u"`context`, `request`, `portal`, `portal_state`,  and "
+                u"`context_state`."),
+            key_type=schema.ASCIILine(),
+            value_type=schema.ASCIILine(),
+            required=False,
+            default={},
+        )
 
     doctype = schema.ASCIILine(
-        title=_('doctype', u"Doctype"),
-        description=_('doctype_description',
-                      u'You can specify a Doctype string which will be set on the '
-                      u'output, for example "<!DOCTYPE html>". '
-                      u'If left blank the default XHTML 1.0 transitional Doctype '
-                      u'or that set in the Diazo theme is used.'),
-        required=False,
-        default="",
-    )
+            title=_('doctype', u"Doctype"),
+            description=_('doctype_description',
+                u'You can specify a Doctype string which will be set on the '
+                u'output, for example "<!DOCTYPE html>". '
+                u'If left blank the default XHTML 1.0 transitional Doctype '
+                u'or that set in the Diazo theme is used.'),
+            required=False,
+            default="",
+        )
 
 
 class IThemingLayer(Interface):
@@ -181,10 +180,10 @@ class IThemePlugin(Interface):
     """
 
     dependencies = schema.Tuple(
-        title=_(u"Dependencies"),
-        description=_(u"Plugins on which this plugin depends"),
-        value_type=schema.ASCIILine(),
-    )
+            title=_(u"Dependencies"),
+            description=_(u"Plugins on which this plugin depends"),
+            value_type=schema.ASCIILine(),
+        )
 
     def onDiscovery(theme, settings, dependenciesSettings):
         """Called when the theme is discovered at startup time. This is
diff --git a/src/plone/app/theming/plugins/__init__.py b/src/plone/app/theming/plugins/__init__.py
index b31d1bd..1de0d9d 100644
--- a/src/plone/app/theming/plugins/__init__.py
+++ b/src/plone/app/theming/plugins/__init__.py
@@ -1,6 +1,6 @@
 # See http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages
 try:
     __import__('pkg_resources').declare_namespace(__name__)
-except ImportError:  # pragma: no cover
+except ImportError: # pragma: no cover
     from pkgutil import extend_path
     __path__ = extend_path(__path__, __name__)
diff --git a/src/plone/app/theming/plugins/hooks.py b/src/plone/app/theming/plugins/hooks.py
index adc3560..b7d4b9d 100644
--- a/src/plone/app/theming/plugins/hooks.py
+++ b/src/plone/app/theming/plugins/hooks.py
@@ -9,7 +9,6 @@
 from plone.app.theming.plugins.utils import getPlugins
 from plone.app.theming.plugins.utils import getPluginSettings
 
-
 def onStartup(event):
     """Call onDiscovery() on each plugin for each theme on startup
     """
@@ -20,9 +19,7 @@ def onStartup(event):
         pluginSettings = getPluginSettings(themeDirectory, plugins)
 
         for name, plugin in plugins:
-            plugin.onDiscovery(themeDirectory.__name__, pluginSettings[
-                               name], pluginSettings)
-
+            plugin.onDiscovery(themeDirectory.__name__, pluginSettings[name], pluginSettings)
 
 def onRequest(object, event):
     """Call onRequest() on each plugin for the eanbled theme on each request
diff --git a/src/plone/app/theming/plugins/utils.py b/src/plone/app/theming/plugins/utils.py
index 8e53f2b..42e96ea 100644
--- a/src/plone/app/theming/plugins/utils.py
+++ b/src/plone/app/theming/plugins/utils.py
@@ -8,44 +8,40 @@
 
 from plone.memoize.ram import cache
 
-
 def pluginsCacheKey(fun):
     return len(list(getUtilitiesFor(IThemePlugin)))
 
-
 def pluginSettingsCacheKey(fun, themeDirectory, plugins=None):
     return themeDirectory.__name__, len(plugins)
 
-
 def sortDependencies(plugins):
     """Topological sort
     """
 
     queue = []
-    waiting = {}  # (n,p) -> [remaining deps]
+    waiting = {} # (n,p) -> [remaining deps]
 
-    for n, p in plugins:
+    for n,p in plugins:
         if p.dependencies:
-            waiting[(n, p)] = list(p.dependencies)
+            waiting[(n,p)] = list(p.dependencies)
         else:
-            queue.append((n, p,))
+            queue.append((n,p,))
 
     while queue:
-        n, p = queue.pop()
-        yield (n, p,)
+        n,p = queue.pop()
+        yield (n,p,)
 
-        for (nw, pw,), deps in waiting.items():
+        for (nw,pw,), deps in waiting.items():
             if n in deps:
                 deps.remove(n)
 
             if not deps:
-                queue.append((nw, pw,))
-                del waiting[(nw, pw,)]
+                queue.append((nw,pw,))
+                del waiting[(nw,pw,)]
 
     if waiting:
         raise ValueError("Could not resolve dependencies for: %s" % waiting)
 
-
 @cache(pluginsCacheKey)
 def getPlugins():
     """Get all registered plugins topologically sorted
@@ -58,7 +54,6 @@ def getPlugins():
 
     return list(sortDependencies(plugins))
 
-
 @cache(pluginSettingsCacheKey)
 def getPluginSettings(themeDirectory, plugins=None):
     """Given an IResourceDirectory for a theme, return the settings for the
@@ -94,7 +89,6 @@ def getPluginSettings(themeDirectory, plugins=None):
 
     pluginSettings = {}
     for name, plugin in plugins:
-        pluginSettings[name] = manifestContents.get(
-            "%s:%s" % (THEME_RESOURCE_NAME, name), {})
+        pluginSettings[name] = manifestContents.get("%s:%s" % (THEME_RESOURCE_NAME, name), {})
 
     return pluginSettings
diff --git a/src/plone/app/theming/testing.py b/src/plone/app/theming/testing.py
index 092a032..6f81ef8 100644
--- a/src/plone/app/theming/testing.py
+++ b/src/plone/app/theming/testing.py
@@ -8,8 +8,6 @@
 from plone.app.testing.layers import IntegrationTesting
 from plone.app.testing.layers import FunctionalTesting
 
-from plone.testing.z2 import ZSERVER_FIXTURE
-
 
 class Theming(PloneSandboxLayer):
     defaultBases = (PLONE_APP_CONTENTTYPES_FIXTURE,)
@@ -17,11 +15,7 @@ class Theming(PloneSandboxLayer):
     def setUpZope(self, app, configurationContext):
         # load ZCML
         import plone.app.theming.tests
-        xmlconfig.file(
-            'configure.zcml',
-            plone.app.theming.tests,
-            context=configurationContext
-        )
+        xmlconfig.file('configure.zcml', plone.app.theming.tests, context=configurationContext)
 
         # Run the startup hook
         from plone.app.theming.plugins.hooks import onStartup
@@ -32,15 +26,6 @@ def setUpPloneSite(self, portal):
         applyProfile(portal, 'plone.app.theming:default')
 
 
-class ThemingAcceptance(Theming):
-    defaultBases = (PLONE_FIXTURE,)
-
-    def setUpZope(self, app, configurationContext):
-        # Run the startup hook
-        from plone.app.theming.plugins.hooks import onStartup
-        onStartup(None)
-
-
 class ThemingWithCaching(Theming):
     defaultBases = (PLONE_APP_CONTENTTYPES_FIXTURE,)
 
@@ -48,10 +33,8 @@ def setUpZope(self, app, configurationContext):
         # load ZCML
         import plone.app.theming.tests
         import plone.app.caching
-        xmlconfig.file(
-            'configure.zcml', plone.app.caching, context=configurationContext)
-        xmlconfig.file(
-            'configure.zcml', plone.app.theming.tests, context=configurationContext)
+        xmlconfig.file('configure.zcml', plone.app.caching, context=configurationContext)
+        xmlconfig.file('configure.zcml', plone.app.theming.tests, context=configurationContext)
 
         # Run the startup hook
         from plone.app.theming.plugins.hooks import onStartup
@@ -61,25 +44,10 @@ def setUpPloneSite(self, portal):
         # install into the Plone site
         applyProfile(portal, 'plone.app.caching:default')
         applyProfile(portal, 'plone.app.theming:default')
-        portal['portal_workflow'].setDefaultChain(
-            'simple_publication_workflow')
+        portal['portal_workflow'].setDefaultChain('simple_publication_workflow')
 
 THEMING_FIXTURE = Theming()
-THEMING_INTEGRATION_TESTING = IntegrationTesting(
-    bases=(THEMING_FIXTURE,),
-    name="Theming:Integration"
-)
-THEMING_FUNCTIONAL_TESTING = FunctionalTesting(
-    bases=(THEMING_FIXTURE,),
-    name="Theming:Functional"
-)
-THEMING_ACCEPTANCE_FIXTURE = ThemingAcceptance()
-THEMING_ACCEPTANCE_TESTING = FunctionalTesting(
-    bases=(THEMING_ACCEPTANCE_FIXTURE, ZSERVER_FIXTURE),
-    name="Theming:Acceptance"
-)
+THEMING_INTEGRATION_TESTING = IntegrationTesting(bases=(THEMING_FIXTURE,), name="Theming:Integration")
+THEMING_FUNCTIONAL_TESTING = FunctionalTesting(bases=(THEMING_FIXTURE,), name="Theming:Functional")
 THEMINGWITHCACHING_FIXTURE = ThemingWithCaching()
-THEMINGWITHCACHING_TESTING = IntegrationTesting(
-    bases=(THEMINGWITHCACHING_FIXTURE,),
-    name="Theming:IntegrationWithCaching"
-)
+THEMINGWITHCACHING_TESTING = IntegrationTesting(bases=(THEMINGWITHCACHING_FIXTURE,), name="Theming:IntegrationWithCaching")
diff --git a/src/plone/app/theming/tests/acceptance/example.txt b/src/plone/app/theming/tests/acceptance/example.txt
deleted file mode 100644
index 109cd91..0000000
--- a/src/plone/app/theming/tests/acceptance/example.txt
+++ /dev/null
@@ -1,23 +0,0 @@
-*** Settings ***
-
-Library  Selenium2Library  timeout=10  implicit_wait=0.5
-
-Suite Setup  Start browser
-Suite Teardown  Close All Browsers
-
-*** Test Cases ***
-
-Plone Accessibility
-    Goto homepage
-    Click link  Accessibility
-    Page should contain  Accessibility Statement
-
-
-*** Keywords ***
-
-Start browser
-    Open browser  http://localhost:55001/plone/
-
-Goto homepage
-    Go to  http://localhost:55001/plone/
-    Page should contain  Plone site
\ No newline at end of file
diff --git a/src/plone/app/theming/tests/acceptance/theme_control_panel.txt b/src/plone/app/theming/tests/acceptance/theme_control_panel.txt
deleted file mode 100644
index 86d4b8c..0000000
--- a/src/plone/app/theming/tests/acceptance/theme_control_panel.txt
+++ /dev/null
@@ -1,144 +0,0 @@
-#  Here is a list of scenarios and tests that we want to implement:
-# https://raw.github.com/gist/3885011/8cd3e5141c12270757a667ce3812319f8c507cb6/gistfile1.txt
-# Run with:
-#  bin/test -s plone.app.theming -t theme_control_panel
-
-*** Settings ***
-
-Library  Selenium2Library  run_on_failure=Capture Page Screenshot
-Variables  plone/app/testing/interfaces.py
-Variables  plone/app/theming/tests/acceptance/variables.py
-
-Suite Setup  Start browser
-Suite Teardown  Close All Browsers
-
-
-*** Test Cases ***
-
-Scenario: Preview theme
-    Given a logged-in admin user
-     And a Plone site with no theme applied
-    When I navigate to the "Theming" control panel
-     And I click on the "Example theme" theme preview
-    Then a preview of "Example theme" is shown in a new window
-
-Scenario: Activate theme
-    Given a logged-in admin user
-     And a Plone site with no theme applied
-    When I navigate to the "Theming" control panel
-     And I click on the "Example theme" "Activate" button
-    Then the "Example theme" is enabled in the site on all pages other than the "Theming" control panel
-
-Scenario: Copy theme
-    Given a logged-in admin user
-     And a Plone site with no theme applied
-    When I navigate to the "Theming" control panel
-     And I click on the "Example theme" "Copy" button
-     And I enter a new title and description
-     And I click "Create"
-    Then a new theme is created
-     And I am taken to the theme editor for this theme
-
-Scenario: Copy theme and enable immediately
-    Given a logged-in admin user
-     And a Plone site with no theme applied
-    When I navigate to the "Theming" control panel
-     And I click on the "Example theme" "Copy" button
-     And I enter a new title and description
-     And I select "enable immediately"
-     And I click "Create"
-    Then a new theme is created
-     And the theme is enabled in the site on all pages other than the "Theming" control panel
-     And I am taken to the theme editor for this theme
-
-Scenario: Create new theme from scratch
-    Given a logged-in admin user
-     And a Plone site with no theme applied
-    When I navigate to the "Theming" control panel
-     And I click on the "New theme" button
-     And I enter a new title and description
-     And I click "Create"
-    Then a new theme is created
-     And I am taken to the theme editor for this theme
-
-# TODO: Not working yet, since the unthemed site does not provide login
-#Scenario: Create new theme from scratch and enable immediately
-#    Given a logged-in admin user
-#     And a Plone site with no theme applied
-#    When I navigate to the "Theming" control panel
-#     And I click on the "New theme" button
-#     And I enter a new title and description
-#     And I select "enable immediately"
-#     And I click "Create"
-#    Then a new theme is created
-#     And the theme is enabled in the site on all pages other than the "Theming" control panel
-#     And I am taken to the theme editor for this theme
-
-*** Keywords ***
-
-Start browser
-    # We add an alias 'Main' so we can Switch back to it from other browsers
-    Open browser  ${PLONE_URL}/plone/  alias=Main
-
-a logged-in admin user
-    Go to  ${PLONE_URL}/login_form
-    Input text  __ac_name  ${SITE_OWNER_NAME}
-    Input text  __ac_password  ${SITE_OWNER_PASSWORD}
-    Click Button  Log in
-
-a Plone site with no theme applied
-    Go to  ${PLONE_URL}
-
-I navigate to the "Theming" control panel
-    Go to  ${PLONE_URL}/@@theming-controlpanel
-
-I click on the "Example theme" theme preview
-    Click Link  xpath=//div[@data-theme-title='Twitter Bootstrap Example']//a
-
-a preview of "Example theme" is shown in a new window
-#    Select Window  title='Preview: Example theme'
-    Page should contain  Plone site
-
-I click on the "Example theme" "Activate" button
-    Click Button  Activate
-
-the "Example theme" is enabled in the site on all pages other than the "Theming" control panel
-    Page should not contain element  css=html head link[href*="++theme++example"]
-    # TODO: Check a selection of other pages.
-    Go to  ${PLONE_URL}
-    Page should contain element  css=html head link[href*="++theme++example"]
-
-I click on the "Example theme" "Copy" button
-    Click Button  Copy
-
-And I click on the "New theme" button
-    Click Button  New theme
-
-I enter a new title and description
-    Input text  title  Test theme
-    Input text  description  This is a test theme
-
-I click "Create"
-    Click Button  Create
-
-a new theme is created
-    Location Should Contain  /++theme++test-theme/
-
-I am taken to the theme editor for this theme
-    Location Should Contain  /++theme++test-theme/@@theming-controlpanel-mapper
-    # This is not as robust as we'd like. Language and parameter dependent.
-    Page should contain  Modify theme
-    Page should contain  Test theme
-
-I select "enable immediately"
-    Select Checkbox   id=enableImmediately
-
-the theme is enabled in the site on all pages other than the "Theming" control panel
-    # We must create a new browser to verify theming, avoiding changing the Main browser page
-    Open Browser  ${PLONE_URL}  alias=ThemedSite
-    Given a logged-in admin user
-    Page should contain element  css=html head link[href*="++theme++test-theme"]    
-    Go to  ${PLONE_URL}/@@theming-controlpanel
-    Page should not contain element  css=html head link[href*="++theme++test-theme"]
-    Close Browser
-    Switch Browser  Main
diff --git a/src/plone/app/theming/tests/acceptance/variables.py b/src/plone/app/theming/tests/acceptance/variables.py
deleted file mode 100644
index dbe1a79..0000000
--- a/src/plone/app/theming/tests/acceptance/variables.py
+++ /dev/null
@@ -1,14 +0,0 @@
-import os
-
-from plone.app.testing.interfaces import PLONE_SITE_ID
-
-PORT = 55001
-if 'ZSERVER_PORT' in os.environ:
-    PORT = os.environ["ZSERVER_PORT"]
-
-ZOPE_URL = "http://localhost:%s" % PORT
-PLONE_URL = "%s/%s" % (ZOPE_URL, PLONE_SITE_ID)
-BROWSER = "Firefox"
-REMOTE_URL = ""
-DESIRED_CAPABILITIES = ""
-TEST_FOLDER = "%s/acceptance-test-folder"
diff --git a/src/plone/app/theming/tests/test_acceptance.py b/src/plone/app/theming/tests/test_acceptance.py
deleted file mode 100644
index d38e41b..0000000
--- a/src/plone/app/theming/tests/test_acceptance.py
+++ /dev/null
@@ -1,22 +0,0 @@
-import os
-import unittest
-
-from plone.testing import layered
-
-import robotsuite
-
-from plone.app.theming.testing import THEMING_ACCEPTANCE_TESTING
-
-
-def test_suite():
-    suite = unittest.TestSuite()
-    current_dir = os.path.abspath(os.path.dirname(__file__))
-    acceptance_dir = os.path.join(current_dir, 'acceptance')
-    acceptance_tests = [os.path.join('acceptance', doc) for doc in
-                        os.listdir(acceptance_dir) if doc.endswith('.txt')]
-    for test in acceptance_tests:
-        suite.addTests([
-            layered(robotsuite.RobotTestSuite(test),
-                    layer=THEMING_ACCEPTANCE_TESTING),
-        ])
-    return suite
diff --git a/src/plone/app/theming/tests/test_controlpanel.py b/src/plone/app/theming/tests/test_controlpanel.py
index ca81a20..19d556b 100644
--- a/src/plone/app/theming/tests/test_controlpanel.py
+++ b/src/plone/app/theming/tests/test_controlpanel.py
@@ -51,15 +51,13 @@ def setUp(self):
             self.browser.handleErrors = False
             self.browser.open(portal.absolute_url() + '/login_form')
             self.browser.getControl(name='__ac_name').value = TEST_USER_NAME
-            self.browser.getControl(
-                name='__ac_password').value = TEST_USER_PASSWORD
+            self.browser.getControl(name='__ac_password').value = TEST_USER_PASSWORD
             self.browser.getControl(name='submit').click()
         finally:
             self.browser.handleErrors = handleErrors
 
     def goto_controlpanel(self):
-        self.browser.open(
-            self.portal.absolute_url() + '/@@theming-controlpanel')
+        self.browser.open(self.portal.absolute_url() + '/@@theming-controlpanel')
 
     def test_create_theme(self):
         pass
diff --git a/src/plone/app/theming/tests/test_exportimport.py b/src/plone/app/theming/tests/test_exportimport.py
index 05d5472..9e8cded 100644
--- a/src/plone/app/theming/tests/test_exportimport.py
+++ b/src/plone/app/theming/tests/test_exportimport.py
@@ -2,7 +2,6 @@
 
 from plone.app.theming.testing import THEMING_INTEGRATION_TESTING
 
-
 class TestExportImport(unittest.TestCase):
 
     layer = THEMING_INTEGRATION_TESTING
@@ -29,12 +28,9 @@ def readDataFile(self, name):
 
         settings = getUtility(IRegistry).forInterface(IThemeSettings, False)
 
-        self.assertEqual(
-            settings.rules, '/++theme++plone.app.theming.tests/rules.xml')
-        self.assertEqual(
-            settings.absolutePrefix, '/++theme++plone.app.theming.tests')
-        self.assertEqual(settings.parameterExpressions, {
-                         'foo': "python:request.get('bar')"})
+        self.assertEqual(settings.rules, '/++theme++plone.app.theming.tests/rules.xml')
+        self.assertEqual(settings.absolutePrefix, '/++theme++plone.app.theming.tests')
+        self.assertEqual(settings.parameterExpressions, {'foo': "python:request.get('bar')"})
 
     def test_import_no_file(self):
         from zope.component import getUtility
@@ -131,3 +127,4 @@ def readDataFile(self, name):
         importTheme(FauxContext())
 
         self.assertEqual(settings.enabled, False)
+
diff --git a/src/plone/app/theming/tests/test_transform.py b/src/plone/app/theming/tests/test_transform.py
index 0624c8c..eb5d2c5 100644
--- a/src/plone/app/theming/tests/test_transform.py
+++ b/src/plone/app/theming/tests/test_transform.py
@@ -18,7 +18,7 @@
 from zope.component import getUtility
 
 from plone.app.theming.interfaces import IThemeSettings
-from plone.app.theming.utils import applyTheme, getTheme
+from plone.app.theming.utils import applyTheme, getAvailableThemes, getTheme
 from plone.app.theming.utils import InternalResolver, PythonResolver, resolvePythonURL
 
 import re
@@ -27,7 +27,6 @@
 
 from Products.CMFCore.utils import getToolByName
 
-
 class TestCase(unittest.TestCase):
 
     layer = THEMING_FUNCTIONAL_TESTING
@@ -41,13 +40,13 @@ def setUp(self):
         self.settings.enabled = False
         self.settings.rules = u'python://plone.app.theming/tests/rules.xml'
         self.settings.parameterExpressions = {
-            'stringParam': 'string:string param value',
-            'boolParam': 'python:False',
-            'contextParam': 'context/absolute_url | string:no context',
-            'requestParam': 'request/useother | string:off',
-        }
+                'stringParam': 'string:string param value',
+                'boolParam': 'python:False',
+                'contextParam' : 'context/absolute_url | string:no context',
+                'requestParam': 'request/useother | string:off',
+            }
 
-        import transaction
+        import transaction;
         transaction.commit()
 
     def tearDown(self):
@@ -79,8 +78,7 @@ def test_theme_enabled(self):
         portal = self.layer['portal']
 
         self.settings.enabled = True
-        import transaction
-        transaction.commit()
+        import transaction; transaction.commit()
 
         browser = Browser(app)
         browser.open(portal.absolute_url())
@@ -102,13 +100,10 @@ def test_theme_enabled_resource_directory(self):
         self.settings.enabled = True
         theme = getTheme('plone.app.theming.tests')
         applyTheme(theme)
-        self.assertEqual(
-            self.settings.rules, u'/++theme++plone.app.theming.tests/rules.xml')
-        self.assertEqual(
-            self.settings.currentTheme, u"plone.app.theming.tests")
+        self.assertEqual(self.settings.rules, u'/++theme++plone.app.theming.tests/rules.xml')
+        self.assertEqual(self.settings.currentTheme, u"plone.app.theming.tests")
         self.assertEqual(self.settings.doctype, u"<!DOCTYPE html>")
-        import transaction
-        transaction.commit()
+        import transaction; transaction.commit()
 
         browser = Browser(app)
         browser.open(portal.absolute_url())
@@ -130,8 +125,7 @@ def test_theme_enabled_query_string_off_switch(self):
         portal = self.layer['portal']
 
         self.settings.enabled = True
-        import transaction
-        transaction.commit()
+        import transaction; transaction.commit()
 
         browser = Browser(app)
         browser.open(portal.absolute_url() + '?diazo.off=1')
@@ -152,8 +146,7 @@ def test_theme_enabled_query_string_off_switch_production_mode(self):
         Globals.DevelopmentMode = False
 
         self.settings.enabled = True
-        import transaction
-        transaction.commit()
+        import transaction; transaction.commit()
 
         browser = Browser(app)
         browser.open(portal.absolute_url() + '?diazo.off=1')
@@ -172,8 +165,7 @@ def test_theme_enabled_header_off(self):
         portal = self.layer['portal']
 
         self.settings.enabled = True
-        import transaction
-        transaction.commit()
+        import transaction; transaction.commit()
 
         browser = Browser(app)
         browser.open(portal.absolute_url() + '/@@header-disabled')
@@ -183,21 +175,19 @@ def test_theme_enabled_header_off(self):
         # The theme
         self.assertFalse("This is the theme" in browser.contents)
 
+
     def test_internal_resolver(self):
         compiler_parser = etree.XMLParser()
         compiler_parser.resolvers.add(InternalResolver())
-        # We can use a sub-package or a directory since tests is a python
-        # package
-        theme = resolvePythonURL(
-            u'python://plone.app.theming.tests/theme.html')
+        # We can use a sub-package or a directory since tests is a python package
+        theme = resolvePythonURL(u'python://plone.app.theming.tests/theme.html')
         rules = resolvePythonURL(u'python://plone.app.theming/tests/rules.xml')
         compile_theme(rules, theme, compiler_parser=compiler_parser)
 
     def test_python_resolver(self):
         compiler_parser = etree.XMLParser()
         compiler_parser.resolvers.add(PythonResolver())
-        theme = resolvePythonURL(
-            u'python://plone.app.theming.tests/theme.html')
+        theme = resolvePythonURL(u'python://plone.app.theming.tests/theme.html')
         rules = resolvePythonURL(u'python://plone.app.theming/tests/rules.xml')
         compile_theme(rules, theme, compiler_parser=compiler_parser)
 
@@ -206,10 +196,8 @@ def test_theme_stored_in_plone_site(self):
         portal = self.layer['portal']
 
         # We'll upload the theme files to the Plone site root
-        rules_contents = open(os.path.join(
-            os.path.split(__file__)[0], 'localrules.xml'))
-        theme_contents = open(os.path.join(
-            os.path.split(__file__)[0], 'theme.html'))
+        rules_contents = open(os.path.join(os.path.split(__file__)[0], 'localrules.xml'))
+        theme_contents = open(os.path.join(os.path.split(__file__)[0], 'theme.html'))
         portal.manage_addDTMLMethod('theme.html', file=theme_contents)
         portal.manage_addDTMLMethod('rules.xml', file=rules_contents)
 
@@ -217,8 +205,7 @@ def test_theme_stored_in_plone_site(self):
         self.settings.rules = u'/rules.xml'
         self.settings.enabled = True
 
-        import transaction
-        transaction.commit()
+        import transaction; transaction.commit()
 
         browser = Browser(app)
         browser.open(portal.absolute_url())
@@ -237,10 +224,8 @@ def test_theme_stored_in_plone_site_works_with_virtual_host(self):
         portal = self.layer['portal']
 
         # We'll upload the theme files to the Plone site root
-        rules_contents = open(os.path.join(
-            os.path.dirname(__file__), 'localrules.xml'))
-        theme_contents = open(os.path.join(
-            os.path.dirname(__file__), 'theme.html'))
+        rules_contents = open(os.path.join(os.path.dirname(__file__), 'localrules.xml'))
+        theme_contents = open(os.path.join(os.path.dirname(__file__), 'theme.html'))
         portal.manage_addDTMLMethod('theme.html', file=theme_contents)
         portal.manage_addDTMLMethod('rules.xml', file=rules_contents)
 
@@ -258,8 +243,7 @@ def test_theme_stored_in_plone_site_works_with_virtual_host(self):
         prefix = '/'.join(portalURL.split('/')[:-1])
         suffix = portalURL.split('/')[-1]
 
-        vhostURL = "%s/VirtualHostBase/http/example.org:80/%s/VirtualHostRoot/_vh_fizz/_vh_buzz/_vh_fizzbuzz/" % (
-            prefix, suffix)
+        vhostURL = "%s/VirtualHostBase/http/example.org:80/%s/VirtualHostRoot/_vh_fizz/_vh_buzz/_vh_fizzbuzz/" % (prefix,suffix)
 
         browser = Browser(app)
         browser.open(vhostURL)
@@ -280,8 +264,7 @@ def test_absolutePrefix_disabled(self):
         self.settings.enabled = True
         self.settings.absolutePrefix = None
 
-        import transaction
-        transaction.commit()
+        import transaction; transaction.commit()
 
         browser = Browser(app)
         browser.open(portal.absolute_url())
@@ -295,15 +278,13 @@ def test_absolutePrefix_enabled_uri(self):
         self.settings.enabled = True
         self.settings.absolutePrefix = u'http://example.com'
 
-        import transaction
-        transaction.commit()
+        import transaction; transaction.commit()
 
         browser = Browser(app)
         browser.open(portal.absolute_url())
 
         self.assertFalse('<img src="relative.jpg" />' in browser.contents)
-        self.assertTrue(
-            '<img src="http://example.com/relative.jpg" />' in browser.contents)
+        self.assertTrue('<img src="http://example.com/relative.jpg" />' in browser.contents)
 
     def test_absolutePrefix_enabled_path(self):
         app = self.layer['app']
@@ -312,15 +293,13 @@ def test_absolutePrefix_enabled_path(self):
         self.settings.enabled = True
         self.settings.absolutePrefix = u'/foo'
 
-        import transaction
-        transaction.commit()
+        import transaction; transaction.commit()
 
         browser = Browser(app)
         browser.open(portal.absolute_url())
 
         self.assertFalse('<img src="relative.jpg" />' in browser.contents)
-        self.assertTrue(
-            '<img src="/plone/foo/relative.jpg" />' in browser.contents)
+        self.assertTrue('<img src="/plone/foo/relative.jpg" />' in browser.contents)
 
     def test_absolutePrefix_enabled_path_vhosting(self):
         app = self.layer['app']
@@ -329,8 +308,7 @@ def test_absolutePrefix_enabled_path_vhosting(self):
         from Products.SiteAccess import VirtualHostMonster
         VirtualHostMonster.manage_addVirtualHostMonster(app, 'virtual_hosting')
 
-        import transaction
-        transaction.commit()
+        import transaction; transaction.commit()
 
         self.settings.enabled = True
         self.settings.absolutePrefix = u'/foo'
@@ -339,18 +317,15 @@ def test_absolutePrefix_enabled_path_vhosting(self):
         prefix = '/'.join(portalURL.split('/')[:-1])
         suffix = portalURL.split('/')[-1]
 
-        vhostURL = "%s/VirtualHostBase/http/example.org:80/%s/VirtualHostRoot/_vh_fizz/_vh_buzz/_vh_fizzbuzz/" % (
-            prefix, suffix)
+        vhostURL = "%s/VirtualHostBase/http/example.org:80/%s/VirtualHostRoot/_vh_fizz/_vh_buzz/_vh_fizzbuzz/" % (prefix,suffix)
 
-        import transaction
-        transaction.commit()
+        import transaction; transaction.commit()
 
         browser = Browser(app)
         browser.open(vhostURL)
 
         self.assertFalse('<img src="relative.jpg" />' in browser.contents)
-        self.assertTrue(
-            '<img src="/fizz/buzz/fizzbuzz/foo/relative.jpg" />' in browser.contents)
+        self.assertTrue('<img src="/fizz/buzz/fizzbuzz/foo/relative.jpg" />' in browser.contents)
 
     def test_theme_installed_invalid_config(self):
         app = self.layer['app']
@@ -359,8 +334,7 @@ def test_theme_installed_invalid_config(self):
         self.settings.enabled = True
         self.settings.rules = u"invalid"
 
-        import transaction
-        transaction.commit()
+        import transaction; transaction.commit()
 
         browser = Browser(app)
         browser.open(portal.absolute_url())
@@ -380,8 +354,7 @@ def test_non_html_content(self):
 
         self.settings.enabled = True
 
-        import transaction
-        transaction.commit()
+        import transaction; transaction.commit()
 
         browser = Browser(app)
         browser.open(portal.absolute_url() + '/document_icon.png')
@@ -454,16 +427,14 @@ def test_resource_condition(self):
 
         # only show in theme
         secondToLastResource = portal_css.resources[-2]
-        secondToLastResource.setExpression(
-            'request/HTTP_X_THEME_ENABLED | nothing')
+        secondToLastResource.setExpression('request/HTTP_X_THEME_ENABLED | nothing')
         secondToLastResource.setRendering('link')
         secondToLastResource.setEnabled(True)
         secondToLastResource.setConditionalcomment('')
 
         # only show when theme is disabled
         lastResource = portal_css.resources[-1]
-        lastResource.setExpression(
-            'not:request/HTTP_X_THEME_ENABLED | nothing')
+        lastResource.setExpression('not:request/HTTP_X_THEME_ENABLED | nothing')
         lastResource.setRendering('link')
         lastResource.setEnabled(True)
         lastResource.setConditionalcomment('')
@@ -473,8 +444,7 @@ def test_resource_condition(self):
         # First try without the theme
         self.settings.enabled = False
 
-        import transaction
-        transaction.commit()
+        import transaction; transaction.commit()
 
         browser = Browser(app)
         browser.open(portal.absolute_url())
@@ -490,8 +460,7 @@ def test_resource_condition(self):
         # Now enable the theme and try again
         self.settings.enabled = True
 
-        import transaction
-        transaction.commit()
+        import transaction; transaction.commit()
 
         browser = Browser(app)
         browser.open(portal.absolute_url())
@@ -516,8 +485,7 @@ def test_theme_different_path(self):
 
         self.settings.enabled = True
 
-        import transaction
-        transaction.commit()
+        import transaction; transaction.commit()
 
         browser = Browser(app)
         browser.open(portal.absolute_url())
@@ -549,14 +517,13 @@ def test_theme_params(self):
         self.settings.enabled = True
         self.settings.rules = u'python://plone.app.theming/tests/paramrules.xml'
         self.settings.parameterExpressions = {
-            'stringParam': 'string:string param value',
-            'boolParam': 'python:False',
-            'contextParam': 'context/absolute_url | string:no context',
-            'requestParam': 'request/someParam | string:off',
-        }
+                'stringParam': 'string:string param value',
+                'boolParam': 'python:False',
+                'contextParam' : 'context/absolute_url | string:no context',
+                'requestParam': 'request/someParam | string:off',
+            }
 
-        import transaction
-        transaction.commit()
+        import transaction; transaction.commit()
 
         browser = Browser(app)
         browser.open(portal.absolute_url())
@@ -577,17 +544,14 @@ def test_theme_params(self):
         self.assertFalse('<script>bool param on</script>' in browser.contents)
 
         # Not present in this request
-        self.assertFalse(
-            '<script>request param on</script>' in browser.contents)
+        self.assertFalse('<script>request param on</script>' in browser.contents)
 
         # Context was available for parameter expressions
-        self.assertTrue(
-            '<script id="contextParam">http://nohost/plone</script>' in browser.contents)
+        self.assertTrue('<script id="contextParam">http://nohost/plone</script>' in browser.contents)
 
         # ... but present with the request param on
         browser.open(portal.absolute_url() + '?someParam=on')
-        self.assertTrue(
-            '<script>request param on</script>' in browser.contents)
+        self.assertTrue('<script>request param on</script>' in browser.contents)
 
     def test_theme_for_404(self):
         app = self.layer['app']
@@ -595,8 +559,7 @@ def test_theme_for_404(self):
 
         self.settings.enabled = True
 
-        import transaction
-        transaction.commit()
+        import transaction; transaction.commit()
 
         browser = Browser(app)
         error = None
@@ -616,14 +579,13 @@ def test_theme_params_on_404(self):
         self.settings.enabled = True
         self.settings.rules = u'python://plone.app.theming/tests/paramrules.xml'
         self.settings.parameterExpressions = {
-            'stringParam': 'string:string param value',
-            'boolParam': 'python:False',
-            'contextParam': 'context/absolute_url | string:no context',
-            'requestParam': 'request/someParam | string:off',
-        }
+                'stringParam': 'string:string param value',
+                'boolParam': 'python:False',
+                'contextParam' : 'context/absolute_url | string:no context',
+                'requestParam': 'request/someParam | string:off',
+            }
 
-        import transaction
-        transaction.commit()
+        import transaction; transaction.commit()
 
         browser = Browser(app)
         error = None
@@ -649,12 +611,10 @@ def test_theme_params_on_404(self):
         self.assertFalse('<script>bool param on</script>' in browser.contents)
 
         # Not present in this request
-        self.assertFalse(
-            '<script>request param on</script>' in browser.contents)
+        self.assertFalse('<script>request param on</script>' in browser.contents)
 
         # Context is the last found parent
-        self.assertTrue(
-            '<script id="contextParam">http://nohost/plone</script>' in browser.contents)
+        self.assertTrue('<script id="contextParam">http://nohost/plone</script>' in browser.contents)
 
     def test_navroot_params_on_404_widget_in_path(self):
         app = self.layer['app']
@@ -694,28 +654,28 @@ def test_resource_condition_404(self):
         thirdLastResource.setEnabled(True)
         thirdLastResource.setConditionalcomment('')
 
+
         # only show in theme
         secondToLastResource = portal_css.resources[-2]
-        secondToLastResource.setExpression(
-            'request/HTTP_X_THEME_ENABLED | nothing')
+        secondToLastResource.setExpression('request/HTTP_X_THEME_ENABLED | nothing')
         secondToLastResource.setRendering('link')
         secondToLastResource.setEnabled(True)
         secondToLastResource.setConditionalcomment('')
 
+
         # only show when theme is disabled
         lastResource = portal_css.resources[-1]
-        lastResource.setExpression(
-            'not:request/HTTP_X_THEME_ENABLED | nothing')
+        lastResource.setExpression('not:request/HTTP_X_THEME_ENABLED | nothing')
         lastResource.setRendering('link')
         lastResource.setEnabled(True)
         lastResource.setConditionalcomment('')
 
+
         portal_css.cookResources()
 
         self.settings.enabled = True
 
-        import transaction
-        transaction.commit()
+        import transaction; transaction.commit()
 
         browser = Browser(app)
 
@@ -758,8 +718,7 @@ def test_includes(self):
         self.settings.rules = u'python://plone.app.theming/tests/includes.xml'
         self.settings.enabled = True
 
-        import transaction
-        transaction.commit()
+        import transaction; transaction.commit()
 
         browser = Browser(app)
 
@@ -784,8 +743,7 @@ def test_css_js_includes(self):
 
         self.settings.enabled = True
         self.settings.rules = u'/++theme++plone.app.theming.tests/css-js.xml'
-        import transaction
-        transaction.commit()
+        import transaction; transaction.commit()
 
         browser = Browser(app)
         browser.open(portal.absolute_url())
@@ -807,8 +765,7 @@ def test_non_ascii_includes(self):
 
         self.settings.enabled = True
         self.settings.rules = u'/++theme++plone.app.theming.tests/nonascii.xml'
-        import transaction
-        transaction.commit()
+        import transaction; transaction.commit()
 
         browser = Browser(app)
         browser.open(portal.absolute_url())
@@ -822,8 +779,7 @@ def test_theme_enabled_query_string_debug_switch(self):
         portal = self.layer['portal']
 
         self.settings.enabled = True
-        import transaction
-        transaction.commit()
+        import transaction; transaction.commit()
 
         browser = Browser(app)
         browser.open(portal.absolute_url() + '?diazo.debug=1')
diff --git a/src/plone/app/theming/tests/test_utils.py b/src/plone/app/theming/tests/test_utils.py
index be0c76d..768a03c 100644
--- a/src/plone/app/theming/tests/test_utils.py
+++ b/src/plone/app/theming/tests/test_utils.py
@@ -36,12 +36,9 @@ def test_getAvailableThemes(self):
         self.assertEqual(theme.__name__, 'plone.app.theming.tests')
         self.assertEqual(theme.title, 'Test theme')
         self.assertEqual(theme.description, 'A theme for testing')
-        self.assertEqual(
-            theme.rules, '/++theme++plone.app.theming.tests/rules.xml')
-        self.assertEqual(
-            theme.absolutePrefix, '/++theme++plone.app.theming.tests')
-        self.assertEqual(theme.parameterExpressions, {
-                         'foo': "python:request.get('bar')"})
+        self.assertEqual(theme.rules, '/++theme++plone.app.theming.tests/rules.xml')
+        self.assertEqual(theme.absolutePrefix, '/++theme++plone.app.theming.tests')
+        self.assertEqual(theme.parameterExpressions, {'foo': "python:request.get('bar')"})
         self.assertEqual(theme.doctype, "<!DOCTYPE html>")
 
     def test_getZODBThemes(self):
@@ -50,8 +47,7 @@ def test_getZODBThemes(self):
         from plone.app.theming.utils import getOrCreatePersistentResourceDirectory
         from plone.app.theming.utils import getZODBThemes
 
-        f = open(os.path.join(os.path.dirname(
-            __file__), 'zipfiles', 'default_rules.zip'))
+        f = open(os.path.join(os.path.dirname(__file__), 'zipfiles', 'default_rules.zip'))
 
         z = zipfile.ZipFile(f)
 
@@ -63,10 +59,8 @@ def test_getZODBThemes(self):
         self.assertEqual(len(zodbThemes), 1)
 
         self.assertEqual(zodbThemes[0].__name__, 'default_rules')
-        self.assertEqual(zodbThemes[
-                         0].rules, '/++theme++default_rules/rules.xml')
-        self.assertEqual(zodbThemes[
-                         0].absolutePrefix, '/++theme++default_rules')
+        self.assertEqual(zodbThemes[0].rules, '/++theme++default_rules/rules.xml')
+        self.assertEqual(zodbThemes[0].absolutePrefix, '/++theme++default_rules')
 
         f.close()
 
@@ -91,8 +85,7 @@ def test_applyTheme(self):
 
         self.assertEqual(settings.rules, theme.rules)
         self.assertEqual(settings.absolutePrefix, theme.absolutePrefix)
-        self.assertEqual(
-            settings.parameterExpressions, theme.parameterExpressions)
+        self.assertEqual(settings.parameterExpressions, theme.parameterExpressions)
         self.assertEqual(settings.doctype, theme.doctype)
 
     def test_applyTheme_None(self):
@@ -149,7 +142,7 @@ def test_isThemeEnabled_blacklist(self):
         self.assertTrue(isThemeEnabled(request, settings))
         self.assertEqual(request.get('SERVER_URL'), 'http://nohost')
 
-        # Should pay no attention to BASE1 and only use SERVER_URL
+        #Should pay no attention to BASE1 and only use SERVER_URL
         settings.hostnameBlacklist.append('nohost')
         self.assertFalse(isThemeEnabled(request, settings))
 
@@ -161,8 +154,7 @@ def test_extractThemeInfo_default_rules(self):
         import os.path
         from plone.app.theming.utils import extractThemeInfo
 
-        f = open(os.path.join(os.path.dirname(
-            __file__), 'zipfiles', 'default_rules.zip'))
+        f = open(os.path.join(os.path.dirname(__file__), 'zipfiles', 'default_rules.zip'))
         z = zipfile.ZipFile(f)
 
         theme = extractThemeInfo(z)
@@ -178,8 +170,7 @@ def test_extractThemeInfo_manifest_rules(self):
         import os.path
         from plone.app.theming.utils import extractThemeInfo
 
-        f = open(os.path.join(os.path.dirname(
-            __file__), 'zipfiles', 'manifest_rules.zip'))
+        f = open(os.path.join(os.path.dirname(__file__), 'zipfiles', 'manifest_rules.zip'))
         z = zipfile.ZipFile(f)
 
         theme = extractThemeInfo(z)
@@ -196,8 +187,7 @@ def test_extractThemeInfo_manifest_prefix(self):
         import os.path
         from plone.app.theming.utils import extractThemeInfo
 
-        f = open(os.path.join(os.path.dirname(
-            __file__), 'zipfiles', 'manifest_prefix.zip'))
+        f = open(os.path.join(os.path.dirname(__file__), 'zipfiles', 'manifest_prefix.zip'))
         z = zipfile.ZipFile(f)
 
         theme = extractThemeInfo(z)
@@ -205,7 +195,7 @@ def test_extractThemeInfo_manifest_prefix(self):
         self.assertEqual(theme.__name__, 'manifest_prefix')
         self.assertEqual(theme.rules, u'/++theme++manifest_prefix/rules.xml')
         self.assertEqual(theme.absolutePrefix, '/foo')
-        self.assertEqual(theme.title, 'Test theme')
+        self.assertEqual(theme.title,  'Test theme')
 
         f.close()
 
@@ -214,18 +204,15 @@ def test_extractThemeInfo_manifest_default_rules(self):
         import os.path
         from plone.app.theming.utils import extractThemeInfo
 
-        f = open(os.path.join(os.path.dirname(
-            __file__), 'zipfiles', 'manifest_default_rules.zip'))
+        f = open(os.path.join(os.path.dirname(__file__), 'zipfiles', 'manifest_default_rules.zip'))
         z = zipfile.ZipFile(f)
 
         theme = extractThemeInfo(z)
 
         self.assertEqual(theme.__name__, 'manifest_default_rules')
-        self.assertEqual(
-            theme.rules, u'/++theme++manifest_default_rules/rules.xml')
-        self.assertEqual(
-            theme.absolutePrefix, '/++theme++manifest_default_rules')
-        self.assertEqual(theme.title, 'Test theme')
+        self.assertEqual(theme.rules, u'/++theme++manifest_default_rules/rules.xml')
+        self.assertEqual(theme.absolutePrefix, '/++theme++manifest_default_rules')
+        self.assertEqual(theme.title,  'Test theme')
 
         f.close()
 
@@ -234,8 +221,7 @@ def test_extractThemeInfo_manifest_preview(self):
         import os.path
         from plone.app.theming.utils import extractThemeInfo
 
-        f = open(os.path.join(os.path.dirname(
-            __file__), 'zipfiles', 'manifest_preview.zip'))
+        f = open(os.path.join(os.path.dirname(__file__), 'zipfiles', 'manifest_preview.zip'))
         z = zipfile.ZipFile(f)
 
         theme = extractThemeInfo(z)
@@ -243,8 +229,8 @@ def test_extractThemeInfo_manifest_preview(self):
         self.assertEqual(theme.__name__, 'manifest_preview')
         self.assertEqual(theme.rules, u'/++theme++manifest_preview/rules.xml')
         self.assertEqual(theme.absolutePrefix, '/++theme++manifest_preview')
-        self.assertEqual(theme.title, 'Test theme')
-        self.assertEqual(theme.preview, 'preview.png')
+        self.assertEqual(theme.title,  'Test theme')
+        self.assertEqual(theme.preview,  'preview.png')
 
         f.close()
 
@@ -253,17 +239,15 @@ def test_extractThemeInfo_manifest_default_rules_override(self):
         import os.path
         from plone.app.theming.utils import extractThemeInfo
 
-        f = open(os.path.join(os.path.dirname(
-            __file__), 'zipfiles', 'manifest_default_rules_override.zip'))
+        f = open(os.path.join(os.path.dirname(__file__), 'zipfiles', 'manifest_default_rules_override.zip'))
         z = zipfile.ZipFile(f)
 
         theme = extractThemeInfo(z)
 
         self.assertEqual(theme.__name__, 'manifest_default_rules_override')
         self.assertEqual(theme.rules, 'other.xml')
-        self.assertEqual(
-            theme.absolutePrefix, '/++theme++manifest_default_rules_override')
-        self.assertEqual(theme.title, 'Test theme')
+        self.assertEqual(theme.absolutePrefix, '/++theme++manifest_default_rules_override')
+        self.assertEqual(theme.title,  'Test theme')
 
         f.close()
 
@@ -272,8 +256,7 @@ def test_extractThemeInfo_nodir(self):
         import os.path
         from plone.app.theming.utils import extractThemeInfo
 
-        f = open(os.path.join(os.path.dirname(
-            __file__), 'zipfiles', 'nodir.zip'))
+        f = open(os.path.join(os.path.dirname(__file__), 'zipfiles', 'nodir.zip'))
         z = zipfile.ZipFile(f)
 
         self.assertRaises(ValueError, extractThemeInfo, z)
@@ -285,8 +268,7 @@ def test_extractThemeInfo_multiple_dir(self):
         import os.path
         from plone.app.theming.utils import extractThemeInfo
 
-        f = open(os.path.join(os.path.dirname(
-            __file__), 'zipfiles', 'multiple_dir.zip'))
+        f = open(os.path.join(os.path.dirname(__file__), 'zipfiles', 'multiple_dir.zip'))
         z = zipfile.ZipFile(f)
 
         self.assertRaises(ValueError, extractThemeInfo, z)
@@ -298,8 +280,7 @@ def test_extractThemeInfo_ignores_dotfiles_resource_forks(self):
         import os.path
         from plone.app.theming.utils import extractThemeInfo
 
-        f = open(os.path.join(os.path.dirname(
-            __file__), 'zipfiles', 'ignores_dotfiles_resource_forks.zip'))
+        f = open(os.path.join(os.path.dirname(__file__), 'zipfiles', 'ignores_dotfiles_resource_forks.zip'))
         z = zipfile.ZipFile(f)
 
         theme = extractThemeInfo(z)
@@ -315,8 +296,7 @@ def test_extractThemeInfo_with_subdirectories(self):
         import os.path
         from plone.app.theming.utils import extractThemeInfo
 
-        f = open(os.path.join(os.path.dirname(
-            __file__), 'zipfiles', 'subdirectories.zip'))
+        f = open(os.path.join(os.path.dirname(__file__), 'zipfiles', 'subdirectories.zip'))
         z = zipfile.ZipFile(f)
 
         theme = extractThemeInfo(z)
diff --git a/src/plone/app/theming/theme.py b/src/plone/app/theming/theme.py
index 606952b..65764ba 100644
--- a/src/plone/app/theming/theme.py
+++ b/src/plone/app/theming/theme.py
@@ -9,13 +9,13 @@ class Theme(object):
     implements(ITheme)
 
     def __init__(self, name, rules,
-                 title=None,
-                 description=None,
-                 absolutePrefix=None,
-                 parameterExpressions=None,
-                 doctype=None,
-                 preview=None,
-                 ):
+            title=None,
+            description=None,
+            absolutePrefix=None,
+            parameterExpressions=None,
+            doctype=None,
+            preview=None,
+    ):
 
         self.__name__ = name
         self.rules = rules
diff --git a/src/plone/app/theming/transform.py b/src/plone/app/theming/transform.py
index c452cb4..7cbab40 100644
--- a/src/plone/app/theming/transform.py
+++ b/src/plone/app/theming/transform.py
@@ -27,7 +27,6 @@
 
 LOGGER = logging.getLogger('plone.app.theming')
 
-
 class _Cache(object):
     """Simple cache for the transform
     """
@@ -42,7 +41,6 @@ def updateTransform(self, transform):
     def updateExpressions(self, expressions):
         self.expressions = expressions
 
-
 def getCache(settings):
     # We need a persistent object to hang a _v_ attribute off for caching.
 
@@ -58,7 +56,6 @@ def getCache(settings):
         cache = caches[key] = _Cache()
     return cache
 
-
 def invalidateCache(settings, event):
     """When our settings are changed, invalidate the cache on all zeo clients
     """
@@ -67,7 +64,6 @@ def invalidateCache(settings, event):
     if hasattr(registry, '_v_plone_app_theming_caches'):
         del registry._v_plone_app_theming_caches
 
-
 class ThemeTransform(object):
     """Late stage in the 8000's transform chain. When plone.app.blocks is
     used, we can benefit from lxml parsing having taken place already.
@@ -109,11 +105,10 @@ def setupTransform(self, runtrace=False):
             readNetwork = settings.readNetwork
             parameterExpressions = settings.parameterExpressions
 
-            transform = compileThemeTransform(
-                rules, absolutePrefix, readNetwork, parameterExpressions, runtrace=runtrace)
+            transform = compileThemeTransform(rules, absolutePrefix, readNetwork, parameterExpressions, runtrace=runtrace)
             if transform is None:
                 return None
-
+            
             if not DevelopmentMode:
                 cache.updateTransform(transform)
 
@@ -161,7 +156,7 @@ def transformIterable(self, result, encoding):
 
         DevelopmentMode = Globals.DevelopmentMode
         runtrace = (DevelopmentMode and
-                    self.request.get('diazo.debug', '').lower() in ('1', 'y', 'yes', 't', 'true'))
+            self.request.get('diazo.debug', '').lower() in ('1', 'y', 'yes', 't', 'true'))
 
         try:
             etree.clear_error_log()
@@ -181,8 +176,7 @@ def transformIterable(self, result, encoding):
                 cache = getCache(settings)
 
             parameterExpressions = settings.parameterExpressions or {}
-            params = prepareThemeParameters(findContext(
-                self.request), self.request, parameterExpressions, cache)
+            params = prepareThemeParameters(findContext(self.request), self.request, parameterExpressions, cache)
 
             transformed = transform(result.tree, **params)
             error_log = transform.error_log
@@ -200,11 +194,10 @@ def transformIterable(self, result, encoding):
             # Add debug information to end of body
             body = result.tree.xpath('/html/body')[0]
             body.insert(-1, generate_debug_html(
-                findContext(
-                    self.request).portal_url() + '/++resource++diazo-debug',
+                findContext(self.request).portal_url() + '/++resource++diazo-debug',
                 rules=settings.rules,
                 rules_parser=getParser('rules', settings.readNetwork),
-                error_log=error_log,
+                error_log = error_log,
             ))
 
         return result
diff --git a/src/plone/app/theming/traversal.py b/src/plone/app/theming/traversal.py
index 7969e9e..3db95d2 100644
--- a/src/plone/app/theming/traversal.py
+++ b/src/plone/app/theming/traversal.py
@@ -10,7 +10,6 @@
 from interfaces import IThemeSettings
 
 
-
 class ThemeTraverser(ResourceTraverser):
     """The theme traverser.
 
diff --git a/src/plone/app/theming/upgrade.py b/src/plone/app/theming/upgrade.py
index 6ca5f29..22d73ff 100644
--- a/src/plone/app/theming/upgrade.py
+++ b/src/plone/app/theming/upgrade.py
@@ -2,13 +2,11 @@
 
 PROFILE_ID = "profile-plone.app.theming:default"
 
-
 def update_registry(context, logger=None):
     # Run the registry.xml step as that may have defined new attributes
     setup = getToolByName(context, 'portal_setup')
     setup.runImportStepFromProfile(PROFILE_ID, 'plone.app.registry')
 
-
 def update_controlpanel(context, logger=None):
     setup = getToolByName(context, 'portal_setup')
     setup.runImportStepFromProfile(PROFILE_ID, 'controlpanel',
diff --git a/src/plone/app/theming/utils.py b/src/plone/app/theming/utils.py
index af12c44..1b278a3 100644
--- a/src/plone/app/theming/utils.py
+++ b/src/plone/app/theming/utils.py
@@ -46,8 +46,6 @@
 from Products.CMFCore.interfaces import ISiteRoot
 from Products.CMFPlone.utils import safe_unicode
 
-DIAZO_OFF_TRUE = ('1', 'y', 'yes', 't', 'true')
-
 
 class NetworkResolver(etree.Resolver):
     """Resolver for network urls
@@ -135,13 +133,13 @@ def resolve(self, system_url, public_id, context):
                 '<html><body><script type="text/javascript">',
                 result,
                 '</script></body></html>',
-            ])
+                ])
         elif content_type == 'text/css':
             result = ''.join([
                 '<html><body><style type="text/css">',
                 result,
                 '</style></body></html>',
-            ])
+                ])
 
         return self.resolve_string(result, context)
 
@@ -233,7 +231,7 @@ def isValidThemeDirectory(directory):
     directory
     """
     return directory.isFile(MANIFEST_FILENAME) or \
-        directory.isFile(RULE_FILENAME)
+           directory.isFile(RULE_FILENAME)
 
 
 def extractThemeInfo(zipfile, checkRules=True):
@@ -245,8 +243,7 @@ def extractThemeInfo(zipfile, checkRules=True):
     Set checkRules=False to disable the rules check.
     """
 
-    resourceName, manifestDict = extractManifestFromZipFile(
-        zipfile, MANIFEST_FORMAT)
+    resourceName, manifestDict = extractManifestFromZipFile(zipfile, MANIFEST_FORMAT)
 
     rulesFile = None
     absolutePrefix = '/++%s++%s' % (THEME_RESOURCE_NAME, resourceName)
@@ -271,17 +268,16 @@ def extractThemeInfo(zipfile, checkRules=True):
                 zipfile.getinfo("%s/%s" % (resourceName, RULE_FILENAME,))
             except KeyError:
                 raise ValueError("Could not find theme name and rules file")
-        rulesFile = u"/++%s++%s/%s" % (
-            THEME_RESOURCE_NAME, resourceName, RULE_FILENAME,)
+        rulesFile = u"/++%s++%s/%s" % (THEME_RESOURCE_NAME, resourceName, RULE_FILENAME,)
 
     return Theme(resourceName, rulesFile,
-                 title=title,
-                 description=description,
-                 absolutePrefix=absolutePrefix,
-                 parameterExpressions=parameters,
-                 doctype=doctype,
-                 preview=preview,
-                 )
+            title=title,
+            description=description,
+            absolutePrefix=absolutePrefix,
+            parameterExpressions=parameters,
+            doctype=doctype,
+            preview=preview,
+        )
 
 
 def getTheme(name, manifest=None, resources=None):
@@ -315,13 +311,13 @@ def getTheme(name, manifest=None, resources=None):
         prefix = prefix.decode('utf-8')
 
     return Theme(name, rules,
-                 title=title,
-                 description=description,
-                 absolutePrefix=prefix,
-                 parameterExpressions=params,
-                 doctype=doctype,
-                 preview=preview,
-                 )
+            title=title,
+            description=description,
+            absolutePrefix=prefix,
+            parameterExpressions=params,
+            doctype=doctype,
+            preview=preview,
+        )
 
 
 def getAvailableThemes():
@@ -367,12 +363,12 @@ def getThemeFromResourceDirectory(resourceDirectory):
         prefix = prefix.decode('utf-8')
 
     return Theme(name, rules,
-                 title=title,
-                 description=description,
-                 absolutePrefix=prefix,
-                 parameterExpressions=params,
-                 doctype=doctype,
-                 )
+                title=title,
+                description=description,
+                absolutePrefix=prefix,
+                parameterExpressions=params,
+                doctype=doctype,
+            )
 
 
 def getZODBThemes():
@@ -420,8 +416,9 @@ def isThemeEnabled(request, settings=None):
         return False
 
     # Check for diazo.off request parameter
-    diazo_off = request.get('diazo.off', '').lower()
-    if (DevelopmentMode and diazo_off in DIAZO_OFF_TRUE):
+    if (DevelopmentMode and
+        request.get('diazo.off', '').lower() in ('1', 'y', 'yes', 't', 'true')
+    ):
         return False
 
     if settings is None:
@@ -547,7 +544,6 @@ def createThemeFromTemplate(title, description, baseOn='template'):
 
     return themeName
 
-
 def getParser(type, readNetwork):
     """Set up a parser for either rules, theme or compiler
     """
@@ -564,7 +560,6 @@ def getParser(type, readNetwork):
         parser.resolvers.add(NetworkResolver())
     return parser
 
-
 def compileThemeTransform(rules, absolutePrefix=None, readNetwork=False, parameterExpressions=None, runtrace=False):
     """Prepare the theme transform by compiling the rules with the given options
     """
@@ -572,35 +567,32 @@ def compileThemeTransform(rules, absolutePrefix=None, readNetwork=False, paramet
     if parameterExpressions is None:
         parameterExpressions = {}
 
-    accessControl = etree.XSLTAccessControl(
-        read_file=True, write_file=False, create_dir=False, read_network=readNetwork, write_network=False)
+    accessControl = etree.XSLTAccessControl(read_file=True, write_file=False, create_dir=False, read_network=readNetwork, write_network=False)
 
     if absolutePrefix:
         absolutePrefix = expandAbsolutePrefix(absolutePrefix)
 
-    params = set(parameterExpressions.keys() + [
-                 'url', 'base', 'path', 'scheme', 'host'])
+    params = set(parameterExpressions.keys() + ['url', 'base', 'path', 'scheme', 'host'])
     xslParams = dict((k, '') for k in params)
 
     compiledTheme = compile_theme(rules,
-                                  absolute_prefix=absolutePrefix,
-                                  parser=getParser('theme', readNetwork),
-                                  rules_parser=getParser('rules', readNetwork),
-                                  compiler_parser=getParser(
-                                  'compiler', readNetwork),
-                                  read_network=readNetwork,
-                                  access_control=accessControl,
-                                  update=True,
-                                  xsl_params=xslParams,
-                                  runtrace=runtrace,
-                                  )
+            absolute_prefix=absolutePrefix,
+            parser=getParser('theme', readNetwork),
+            rules_parser=getParser('rules', readNetwork),
+            compiler_parser=getParser('compiler', readNetwork),
+            read_network=readNetwork,
+            access_control=accessControl,
+            update=True,
+            xsl_params=xslParams,
+            runtrace=runtrace,
+        )
 
     if not compiledTheme:
         return None
 
     return etree.XSLT(compiledTheme,
-                      access_control=accessControl,
-                      )
+            access_control=accessControl,
+        )
 
 
 def prepareThemeParameters(context, request, parameterExpressions, cache=None):
@@ -616,12 +608,12 @@ def prepareThemeParameters(context, request, parameterExpressions, cache=None):
     parts = urlsplit(base.lower())
 
     params = dict(
-        url=quote_param(url),
-        base=quote_param(base),
-        path=quote_param(path),
-        scheme=quote_param(parts.scheme),
-        host=quote_param(parts.netloc),
-    )
+            url=quote_param(url),
+            base=quote_param(base),
+            path=quote_param(path),
+            scheme=quote_param(parts.scheme),
+            host=quote_param(parts.netloc),
+        )
 
     # Add expression-based parameters
     if parameterExpressions:
diff --git a/travis.cfg b/travis.cfg
index 72616d1..b0d1094 100644
--- a/travis.cfg
+++ b/travis.cfg
@@ -8,6 +8,4 @@ allow-hosts =
     *.python.org
     docutils.sourceforge.net
     prdownloads.sourceforge.net
-    effbot.org
-    code.google.com
-    robotframework.googlecode.com
\ No newline at end of file
+    effbot.org
\ No newline at end of file




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


More information about the Testbot mailing list