本文整理汇总了Python中flask_assets.Environment.manifest方法的典型用法代码示例。如果您正苦于以下问题:Python Environment.manifest方法的具体用法?Python Environment.manifest怎么用?Python Environment.manifest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类flask_assets.Environment
的用法示例。
在下文中一共展示了Environment.manifest方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: init_app
# 需要导入模块: from flask_assets import Environment [as 别名]
# 或者: from flask_assets.Environment import manifest [as 别名]
def init_app(app):
webassets = Environment(app)
webassets.register('css_all', css_all)
webassets.register('js_vendor', js_vendor)
webassets.manifest = 'cache' if not app.debug else False
webassets.cache = not app.debug
webassets.debug = app.debug
示例2: init_app
# 需要导入模块: from flask_assets import Environment [as 别名]
# 或者: from flask_assets.Environment import manifest [as 别名]
def init_app(self, app):
env = Environment(app)
env.url_expire = True
env.register('css_app', css_app)
env.register('js_app', js_app)
env.manifest = 'cache' if not app.debug else False
env.cache = not app.debug
env.debug = app.debug
示例3: init_app
# 需要导入模块: from flask_assets import Environment [as 别名]
# 或者: from flask_assets.Environment import manifest [as 别名]
def init_app(app):
assets = Environment(app)
assets.register("css_vendor", css_vendor)
assets.register("js_vendor", js_vendor)
assets.register("css_linkedlist", css_linkedlist)
assets.manifest = 'cache' if not app.debug else False
assets.cache = not app.debug
assets.debug = app.debug
示例4: init_app
# 需要导入模块: from flask_assets import Environment [as 别名]
# 或者: from flask_assets.Environment import manifest [as 别名]
def init_app(app):
webassets = Environment(app)
webassets.url = app.static_url_path
webassets.register('js_lodjers', js_lodjers)
webassets.register('js_mixpanel', js_mixpanel)
webassets.register('css_lodjers', css_lodjers)
webassets.manifest = 'cache' if not app.debug else False
webassets.cache = not app.debug
webassets.debug = app.debug
示例5: init_app
# 需要导入模块: from flask_assets import Environment [as 别名]
# 或者: from flask_assets.Environment import manifest [as 别名]
def init_app(app):
"""
Initilize assets.
:param app:
"""
webassets = Environment(app)
webassets.url = app.static_url_path
webassets.register('css_all', css_all)
webassets.manifest = 'cache' if not app.debug else False
webassets.cache = not app.debug
webassets.debug = app.debug
示例6: prepare
# 需要导入模块: from flask_assets import Environment [as 别名]
# 或者: from flask_assets.Environment import manifest [as 别名]
def prepare(app):
web_assets = Environment(app)
web_assets.register('css_all', *prepare_css())
web_assets.register('js_all', *prepare_js())
is_debugging = app.debug
web_assets.manifest = 'cache' if not is_debugging else False
web_assets.cache = not is_debugging
web_assets.debug = is_debugging
return app
示例7: init_app
# 需要导入模块: from flask_assets import Environment [as 别名]
# 或者: from flask_assets.Environment import manifest [as 别名]
def init_app(app, allow_auto_build=True):
assets = Environment(app)
# on google app engine put manifest file beside code
# static folders are stored separately and there is no access to them in production
folder = os.path.abspath(os.path.dirname(__file__)) if "APPENGINE_RUNTIME" in os.environ else ""
assets.directory = os.path.join(app.static_folder, "compressed")
assets.manifest = "json:{}/manifest.json".format(assets.directory)
assets.url = app.static_url_path + "/compressed"
compress = not app.debug # and False
assets.debug = not compress
assets.auto_build = compress and allow_auto_build
assets.register('js', Bundle(*JS, filters='yui_js', output='script.%(version)s.js'))
assets.register('css', Bundle(*CSS, filters='yui_css', output='style.%(version)s.css'))
示例8: init_app
# 需要导入模块: from flask_assets import Environment [as 别名]
# 或者: from flask_assets.Environment import manifest [as 别名]
def init_app(app):
webassets = Environment(app)
webassets.register('css_bootstrap', css_bootstrap)
#webassets.register('css_local', css_local)
#webassets.register('js_local', js_local)
#webassets.register('js_jquery', js_jquery)
webassets.register('js_bootstrap', js_bootstrap)
#webassets.register('js_angular', js_angular)
#webassets.register('js_coffee', js_coffee)
webassets.manifest = 'cache' if not app.debug else False
webassets.cache = not app.debug
webassets.debug = app.debug
示例9: init_app
# 需要导入模块: from flask_assets import Environment [as 别名]
# 或者: from flask_assets.Environment import manifest [as 别名]
def init_app(app):
debug = app.debug
webassets = Environment(app)
# add foundation sass files to sass compiler paths
webassets.config['SASS_LOAD_PATHS'] = ["../bower_components/foundation/scss/",
"."]
webassets.register('css_kb', css_kb)
webassets.register('shivs', shivs)
webassets.register('js_vendor', js_vendor)
webassets.register('js_main', js_main)
webassets.manifest = 'cache' if not debug else False
webassets.cache = not debug
webassets.debug = debug
示例10: Flask
# 需要导入模块: from flask_assets import Environment [as 别名]
# 或者: from flask_assets.Environment import manifest [as 别名]
SITE_ROOT = os.path.dirname(os.path.realpath(__file__))
FLATPAGES_AUTO_RELOAD = DEBUG
FLATPAGES_EXTENSION = '.md'
# LESS_BIN = os.path.join(SCRIPT_ROOT, '..', 'node_modules', 'less', 'bin', 'lessc')
LESS_LINE_NUMBERS = 'mediaquery'
FREEZER_DESTINATION = os.path.join(SITE_ROOT, '..', '..', 'build')
FLATPAGES_ROOT = os.path.join(SITE_ROOT, '..', '..', 'pages')
app = Flask(
import_name='codingnotes',
static_folder=os.path.join(SITE_ROOT, '..', '..', 'static'),
template_folder=os.path.join(SITE_ROOT, '..', '..', 'templates'),
)
assets = Environment(app)
assets.manifest = False
assets.cache = False
if DEBUG:
assets.manifest = False
assets.cache = None
freezer = Freezer(app)
pages_on_disk = FlatPages(app)
app.config.from_object(__name__)
def is_published(post_date):
return utc.localize(datetime.utcnow()) >= utc.localize(datetime.combine(post_date, time(0, 0, 0)))
published_pages = sorted([p for p in pages_on_disk if is_published(p.meta.get('date', '2099-12-31'))], key=lambda p: p.meta['date'])
示例11: Flask
# 需要导入模块: from flask_assets import Environment [as 别名]
# 或者: from flask_assets.Environment import manifest [as 别名]
FLATPAGES_AUTO_RELOAD = DEBUG
FLATPAGES_EXTENSION = '.md'
# LESS_BIN = os.path.join(SCRIPT_ROOT, '..', 'node_modules', 'less', 'bin', 'lessc')
LESS_LINE_NUMBERS = 'mediaquery'
FREEZER_DESTINATION = os.path.join(SITE_ROOT, '..', '..', 'build')
FLATPAGES_ROOT = os.path.join(SITE_ROOT, '..', '..', 'pages')
app = Flask(
import_name='codingnotes',
static_folder=os.path.join(SITE_ROOT, '..', '..', 'static'),
template_folder=os.path.join(SITE_ROOT, '..', '..', 'templates'),
)
assets = Environment(app)
assets.debug = DEBUG
assets.manifest = None
assets.cache = None
freezer = Freezer(app)
pages_on_disk = FlatPages(app)
app.config.from_object(__name__)
def is_published(post_date):
return utc.localize(datetime.utcnow()) >= utc.localize(datetime.combine(post_date, time(0, 0, 0)))
published_pages = sorted([p for p in pages_on_disk if is_published(p.meta.get('date', '2099-12-31'))], key=lambda p: p.meta['date'])
def get_latest_pages(limit=10):
pages = published_pages if not request.args.get('preview') else pages_on_disk
# Articles are pages with a publication date