コード例 #1
0
def build():
    """Builds all bundles.

    Builds bundles, regardless of whether they are changed or not.
    """
    script.main(['build'], webassets_tools.env)
    click.secho(u'Compile assets: SUCCESS', fg=u'green', bold=True)
コード例 #2
0
def clean():
    u'''Will clear out the cache, which after a while can grow quite large.'''
    try:
        script.main(['clean'], webassets_tools.env)
    except BundleError as e:
        return error_shout(e)
    click.secho(u'Clear cache: SUCCESS', fg=u'green', bold=True)
コード例 #3
0
def watch():
    u'''Start a daemon which monitors source files, and rebuilds bundles.

    This can be useful during development, if building is not
    instantaneous, and you are losing valuable time waiting for the
    build to finish while trying to access your site.

    '''
    script.main(['watch'], webassets_tools.env)
コード例 #4
0
def test_script():
    """Test simply that the main script can be invoked."""
    main([])
コード例 #5
0
ファイル: build_assets.py プロジェクト: tymiles003/oncall-2
def main():
    script.main(sys.argv[1:], env=assets_env)
コード例 #6
0
ファイル: test_script.py プロジェクト: sbarysiuk/webassets
def test_script():
    main([])
コード例 #7
0
ファイル: asset.py プロジェクト: PublicaMundi/ckan
def build():
    u'''Builds bundles, regardless of whether they are changed or not.'''
    script.main(['build'], webassets_tools.env)
    click.secho(u'Compile assets: SUCCESS', fg=u'green', bold=True)
コード例 #8
0
ファイル: manage.py プロジェクト: bennullgraham/Holzofen
def assets_rebuild():
    from webassets import script
    env = app.jinja_env.assets_environment
    script.main(('build', '--no-cache'), env=env)
コード例 #9
0
ファイル: assets.py プロジェクト: 1gnatov/sqlalchemy-wrapper
    'styles/normalize.css',
    'styles/font-awesome.css',
    'styles/main.css',
    'styles/type.css',
    'styles/responsive.css',
    'styles/pygments.css',
    'styles/magnific-popup.css',
    'styles/print.css',

    filters='less,cssmin',
    output='styles/styles.min.css'
)

assets_env.register(
    'js_main',

    'scripts/jquery.js',
    'scripts/lodash.js',
    'scripts/doctools.js',
    'scripts/magnific-popup.js',
    'scripts/main.js',

    filters='closure_js',
    output='scripts/scripts.min.js'
)

if __name__ == '__main__':
    import sys
    from webassets import script
    script.main(sys.argv[1:], env=assets_env)
コード例 #10
0
ファイル: dermshare.py プロジェクト: spressomonkey/dermshare
    parser.add_option('--debug-assets',
                      dest='_debug_assets',
                      action='store_true',
                      help='debug asset bundling')
    parser.add_option('--build-assets',
                      dest='_build_assets',
                      action="store_true",
                      help='bundle assets')

    (opts, args) = parser.parse_args()
    # Load config file if specified
    if opts.config is not None:
        app.config.from_pyfile(opts.config)
    # Overwrite only those settings specified on the command line
    for k in dir(opts):
        if not k.startswith('_') and getattr(opts, k) is None:
            delattr(opts, k)
    app.config.from_object(opts)

    if opts._debug_assets:
        app.config['DEBUG'] = True
        app.config['ASSETS_DEBUG'] = False
    else:
        app.config['ASSETS_DEBUG'] = app.config['DEBUG']

    if opts._build_assets:
        from webassets import script
        script.main(['build', '--production'], env=assets)
    else:
        app.run(host=opts.host, port=opts.port, threaded=True)
コード例 #11
0
def main():
    script.main(sys.argv[1:], env=env)
コード例 #12
0
ファイル: manage.py プロジェクト: boldfield/decanter
 def run(self, *args):
     from webassets import script
     app = create_app()
     script.main(args, env=app.assets)
コード例 #13
0
ファイル: manage.py プロジェクト: pooldin/pooldwww
 def run(self, *args):
     from webassets import script
     script.main(args, env=app.assets)
 def run(self, *args):
     from webassets import script
     app = create_app()
     script.main(args, env=app.assets)
コード例 #15
0
ファイル: dermshare.py プロジェクト: spressomonkey/dermshare
    parser.add_option('-w', '--websocket', metavar='BASE-URL',
                dest='WEBSOCKET_BASEURL',
                help='base URL for websocket server')

    parser.add_option('--debug-assets', dest='_debug_assets', action='store_true',
                help='debug asset bundling')
    parser.add_option('--build-assets', dest='_build_assets', action="store_true",
                help='bundle assets')

    (opts, args) = parser.parse_args()
    # Load config file if specified
    if opts.config is not None:
        app.config.from_pyfile(opts.config)
    # Overwrite only those settings specified on the command line
    for k in dir(opts):
        if not k.startswith('_') and getattr(opts, k) is None:
            delattr(opts, k)
    app.config.from_object(opts)

    if opts._debug_assets:
        app.config['DEBUG'] = True
        app.config['ASSETS_DEBUG'] = False
    else:
        app.config['ASSETS_DEBUG'] = app.config['DEBUG']

    if opts._build_assets:
        from webassets import script
        script.main(['build', '--production'], env=assets)
    else:
        app.run(host=opts.host, port=opts.port, threaded=True)
コード例 #16
0
 def run(self, *args):
     from webassets import script
     script.main(args, env=app.assets)