本文整理汇总了Python中tornado.web.StaticFileHandler.get_version方法的典型用法代码示例。如果您正苦于以下问题:Python StaticFileHandler.get_version方法的具体用法?Python StaticFileHandler.get_version怎么用?Python StaticFileHandler.get_version使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tornado.web.StaticFileHandler
的用法示例。
在下文中一共展示了StaticFileHandler.get_version方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: append_version
# 需要导入模块: from tornado.web import StaticFileHandler [as 别名]
# 或者: from tornado.web.StaticFileHandler import get_version [as 别名]
def append_version(cls, path):
# this version is cached on the StaticFileHandler class,
# keyed by absolute filesystem path, and only invalidated
# on an explicit StaticFileHandler.reset(). The reset is
# automatic on every request if you set
# static_hash_cache=False in TornadoApplication kwargs.
version = StaticFileHandler.get_version(dict(static_path=settings.bokehjsdir()), path)
return ("%s?v=%s" % (path, version))
示例2: append_version
# 需要导入模块: from tornado.web import StaticFileHandler [as 别名]
# 或者: from tornado.web.StaticFileHandler import get_version [as 别名]
def append_version(cls, path):
# This version is cached on the StaticFileHandler class,
# keyed by absolute filesystem path, and only invalidated
# on an explicit StaticFileHandler.reset(). The reset is
# automatic on every request if you set static_hash_cache=False
# in TornadoApplication kwargs. In dev mode rely on dev tools
# to manage caching. This improves the ability to debug code.
if settings.dev:
return path
else:
version = StaticFileHandler.get_version(dict(static_path=settings.bokehjsdir()), path)
return ("%s?v=%s" % (path, version))
示例3: static_url_on_ie
# 需要导入模块: from tornado.web import StaticFileHandler [as 别名]
# 或者: from tornado.web.StaticFileHandler import get_version [as 别名]
def static_url_on_ie(cls, path):
version_hash = StaticFileHandler.get_version(Settings.settings(), path)
return '%s?v=%s' % ('/s/'+path, version_hash)