本文整理汇总了Python中webassets.Environment.config['JST_COMPILER']方法的典型用法代码示例。如果您正苦于以下问题:Python Environment.config['JST_COMPILER']方法的具体用法?Python Environment.config['JST_COMPILER']怎么用?Python Environment.config['JST_COMPILER']使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类webassets.Environment
的用法示例。
在下文中一共展示了Environment.config['JST_COMPILER']方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _setup_env
# 需要导入模块: from webassets import Environment [as 别名]
# 或者: from webassets.Environment import config['JST_COMPILER'] [as 别名]
def _setup_env(debug=True, cache=True):
"""Setup the webassets environment."""
env = Environment(INPUT_FILES, OUTPUT_FILES)
# We use underscore's templates by default.
env.config['JST_COMPILER'] = '_.template'
if debug:
env.config['CLOSURE_COMPRESSOR_OPTIMIZATION'] = 'WHITESPACE_ONLY'
env.manifest = False
else:
env.config['CLOSURE_COMPRESSOR_OPTIMIZATION'] = 'ADVANCED_OPTIMIZATIONS'
env.debug = False
env.cache = cache
#javascript
_bundle_app_jsts(env, debug)
_bundle_app_coffee(env, debug)
_bundle_3rd_party_js(env, debug)
#css
_bundle_app_less(env, debug)
_bundle_3rd_party_css(env, debug)
#images
_bundle_images(env)
return env
示例2: _setup_env
# 需要导入模块: from webassets import Environment [as 别名]
# 或者: from webassets.Environment import config['JST_COMPILER'] [as 别名]
def _setup_env(app='', debug=True, cache=True):
"""Setup the webassets environment."""
if app:
app_path = path.join('..', '..', app, 'static')
env = Environment(
path.join(INPUT_FILES, '..', '..', 'skel', 'assets'),
path.join(BASE_LOCATION, '..'))
else:
app_path = path.join('..', 'static')
env = Environment(
path.join(INPUT_FILES, '..', '..', 'skel', 'assets'),
path.join(BASE_LOCATION))
# We use underscore's templates by default.
env.config['JST_COMPILER'] = '_.template'
if debug:
env.config['CLOSURE_COMPRESSOR_OPTIMIZATION'] = 'WHITESPACE_ONLY'
env.manifest = False
else:
env.config['CLOSURE_COMPRESSOR_OPTIMIZATION'] = 'ADVANCED_OPTIMIZATIONS'
env.debug = False
env.cache = cache
#javascript
_bundle_app_coffee(app_path, env, debug)
_bundle_3rd_party_js(app_path, env, debug)
#css
_bundle_3rd_party_css(app_path, env, debug)
#images
_bundle_images(app, env, is_skel=True)
return env