本文整理汇总了Python中webassets.script.CommandLineEnvironment.clean方法的典型用法代码示例。如果您正苦于以下问题:Python CommandLineEnvironment.clean方法的具体用法?Python CommandLineEnvironment.clean怎么用?Python CommandLineEnvironment.clean使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类webassets.script.CommandLineEnvironment
的用法示例。
在下文中一共展示了CommandLineEnvironment.clean方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: clear_css_cache
# 需要导入模块: from webassets.script import CommandLineEnvironment [as 别名]
# 或者: from webassets.script.CommandLineEnvironment import clean [as 别名]
def clear_css_cache():
import logging
from webassets.script import CommandLineEnvironment
# Setup a logger
log = logging.getLogger('webassets')
log.addHandler(logging.StreamHandler())
log.setLevel(logging.DEBUG)
cmdenv = CommandLineEnvironment(assets, log)
cmdenv.clean()
示例2: bundle
# 需要导入模块: from webassets.script import CommandLineEnvironment [as 别名]
# 或者: from webassets.script.CommandLineEnvironment import clean [as 别名]
def bundle(**kwargs):
"""
Webassets bundle management.
usage: blueberrypy bundle [options]
Before you can use this command to bundle up your Web assets, you should
have created either a project skeleton using the 'create' command or
provided a configuration directory using the global option -c --config_dir.
options:
-h, --help show this help message and exit
-b, --build build the asset bundles
-w, --watch automatically rebuild the asset bundles upon changes in the
static directory
-c, --clean delete the generated asset bundles
"""
config = BlueberryPyConfiguration(config_dir=kwargs.get("config_dir"))
assets_env = config.webassets_env
if not assets_env:
raise BlueberryPyNotConfiguredError("Webassets configuration not found.")
from webassets.script import CommandLineEnvironment
assets_cli = CommandLineEnvironment(assets_env, logger)
if kwargs.get("build"):
try:
assets_cli.build()
except AttributeError:
assets_cli.rebuild()
elif kwargs.get("watch"):
assets_cli.watch()
elif kwargs.get("clean"):
assets_cli.clean()
示例3: clean_assets
# 需要导入模块: from webassets.script import CommandLineEnvironment [as 别名]
# 或者: from webassets.script.CommandLineEnvironment import clean [as 别名]
def clean_assets():
log = logging.getLogger('webassets')
log.addHandler(logging.StreamHandler())
log.setLevel(logging.DEBUG)
cmdenv = CommandLineEnvironment(assets_env, log)
cmdenv.clean()