Esempio n. 1
0
    def init_manifest(self, name):
        """
        Initialize a manifest instance

        Arguments:
            name (string): Config name to register.

        Returns:
            CodeMirrorManifest: A manifest instance where config (from
            ``config_name`` attribute) is registred.
        """
        manifesto = CodeMirrorManifest()
        manifesto.register(name)
        return manifesto
Esempio n. 2
0
    def init_manifest(self, name):
        """
        Initialize a manifest instance

        Arguments:
            name (string): Config name to register.

        Returns:
            CodeMirrorManifest: A manifest instance where config (from
            ``config_name`` attribute) is registred.
        """
        manifesto = CodeMirrorManifest()
        manifesto.register(name)
        return manifesto
Esempio n. 3
0
def manifesto():
    """Return a CodeMirrorManifest instance"""
    return CodeMirrorManifest()
Esempio n. 4
0
"""
try:
    from django_assets import Bundle
    from django_assets import register as asset_register
except ImportError:
    DJANGO_ASSETS_INSTALLED = False
else:
    import copy

    DJANGO_ASSETS_INSTALLED = True

    from django.conf import settings
    from djangocodemirror.manifest import CodeMirrorManifest

    for name, opts in settings.CODEMIRROR_SETTINGS.items():
        manifesto = CodeMirrorManifest()

        manifesto.register(name)
        config = manifesto.registry[name]

        if config.get('css_bundle_name'):
            css_options = copy.deepcopy(settings.BUNDLES_CSS_OPTIONS)
            if 'output' in css_options:
                css_options['output'] = css_options['output'].format(
                    settings_name=name
                )
            css_bundle = Bundle(*manifesto.css(name), **css_options)
            asset_register(config['css_bundle_name'], css_bundle)

        if config.get('js_bundle_name'):
            js_options = copy.deepcopy(settings.BUNDLES_JS_OPTIONS)