-
-
Notifications
You must be signed in to change notification settings - Fork 188
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TMP - Fixes test setup for yet unknown reason.
- Loading branch information
Showing
4 changed files
with
195 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
from ..browser.combine import combine_bundles | ||
from plone.registry.interfaces import IRegistry | ||
from zope.component import queryUtility | ||
|
||
|
||
def combine(context): | ||
logger = context.getLogger("bundles") | ||
registry = queryUtility(IRegistry) | ||
|
||
if registry is None: | ||
logger.info("Cannot find registry") | ||
return | ||
|
||
# Look for a keyword in registry.xml or the registry directory. | ||
filepaths = ["registry.xml"] | ||
if context.isDirectory("registry"): | ||
for filename in context.listDirectory("registry"): | ||
filepaths.append("registry/" + filename) | ||
found = False | ||
for filepath in filepaths: | ||
body = context.readDataFile(filepath) | ||
if body is not None and b"IBundleRegistry" in body: | ||
found = True | ||
break | ||
if not found: | ||
return | ||
|
||
# Calling combine_bundles used to have as side effect that the | ||
# Content-Type header of the response was set to application/javascript, | ||
# which we do not want. But that was fixed already in Plone 5.1b2. | ||
# See https://github.com/plone/Products.CMFPlone/pull/1924 | ||
site = context.getSite() | ||
combine_bundles(site) |