def pin_responsivevoice(setup_tool): """Use version 1.5 of the ResponsiveVoice API.""" if IS_PLONE_5: return # upgrade step not supported under Plone 5 portal_js = api.portal.get_tool('portal_javascripts') if OLD_JS in portal_js.getResourceIds(): portal_js.renameResource(OLD_JS, NEW_JS) assert NEW_JS in portal_js.getResourceIds() logger.info('ResponsiveVoice version updated to 1.5.')
def update_library_condition(setup_tool): """Update the condition used to load ResponsiveVoice library.""" if IS_PLONE_5: return # upgrade step not supported under Plone 5 portal_js = api.portal.get_tool('portal_javascripts') resource = portal_js.getResource(JS) if resource is not None: resource.setExpression(EXPRESSION) assert resource.getExpression() == EXPRESSION logger.info('Condition used to load ResponsiveVoice updated.')
def cook_css_resources(context): # pragma: no cover """Cook CSS resources.""" css_tool = api.portal.get_tool('portal_css') css_tool.cookResources() logger.info('CSS resources were cooked')
def cook_javascript_resources(context): # pragma: no cover """Cook JavaScript resources.""" js_tool = api.portal.get_tool('portal_javascripts') js_tool.cookResources() logger.info('JavaScript resources were cooked')