""" __all__ = [ 'ManifestedStaticURLGenerator' ] from itertools import cycle from zope.component import adapts from zope.interface import implements from weblayer.interfaces import IRequest, ISettings, IStaticURLGenerator from weblayer.settings import require_setting require_setting('static_url_prefix', default=u'/static/') require_setting('assetgen_manifest') class ManifestedStaticURLGenerator(object): """ Adapter to generate static URLs using an `Assetgen`_ manifest file. _`Assetgen`: http://pypi.python.org/pypi/assetgen """ adapts(IRequest, ISettings) implements(IStaticURLGenerator) def __init__(self, request, settings): self._dev = settings.get('dev', False) self._host = settings.get('static_host', request.host)
from weblayer.settings import require, require_setting from weblayer.settings import override, override_setting require_setting('test_module', category='weblayer.tests') @require('test_function', category='weblayer.tests') def foo(): # pragma: no cover pass class Foo(object): @require('test_method', category='weblayer.tests') def bar(self): # pragma: no cover pass
#!/usr/bin/env python # -*- coding: utf-8 -*- from weblayer.settings import require_setting, override require_setting( 'test_override_function', default='something', category='weblayer.tests' ) @override( 'test_override_function', default='something else', category='weblayer.tests' ) def foo(): # pragma: no cover pass
_`Assetgen`: http://pypi.python.org/pypi/assetgen """ __all__ = ['ManifestedStaticURLGenerator'] from itertools import cycle from zope.component import adapts from zope.interface import implements from weblayer.interfaces import IRequest, ISettings, IStaticURLGenerator from weblayer.settings import require_setting require_setting('static_url_prefix', default=u'/static/') require_setting('assetgen_manifest') class ManifestedStaticURLGenerator(object): """ Adapter to generate static URLs using an `Assetgen`_ manifest file. _`Assetgen`: http://pypi.python.org/pypi/assetgen """ adapts(IRequest, ISettings) implements(IStaticURLGenerator) def __init__(self, request, settings): self._dev = settings.get('dev', False)
#!/usr/bin/env python # -*- coding: utf-8 -*- from weblayer.settings import require_setting, override require_setting('test_override_function', default='something', category='weblayer.tests') @override('test_override_function', default='something else', category='weblayer.tests') def foo(): # pragma: no cover pass