本文整理汇总了Python中tornado.web.StaticFileHandler.initialize方法的典型用法代码示例。如果您正苦于以下问题:Python StaticFileHandler.initialize方法的具体用法?Python StaticFileHandler.initialize怎么用?Python StaticFileHandler.initialize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tornado.web.StaticFileHandler
的用法示例。
在下文中一共展示了StaticFileHandler.initialize方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: initialize
# 需要导入模块: from tornado.web import StaticFileHandler [as 别名]
# 或者: from tornado.web.StaticFileHandler import initialize [as 别名]
def initialize(self, **kwargs):
if 'no_cache' in kwargs:
self._no_cache = kwargs['no_cache']
del kwargs['no_cache']
else:
self._no_cache = False
StaticFileHandler.initialize(self, **kwargs)
示例2: initialize
# 需要导入模块: from tornado.web import StaticFileHandler [as 别名]
# 或者: from tornado.web.StaticFileHandler import initialize [as 别名]
def initialize(self):
# return custom type directly. The browser will do the parsing
self.custom_type = None
uri = self.get_argument('uri')
try:
self.modgui = get_plugin_gui(uri)
except:
raise HTTPError(404)
try:
root = self.modgui['resourcesDirectory']
except:
raise HTTPError(404)
return StaticFileHandler.initialize(self, root)
示例3: initialize
# 需要导入模块: from tornado.web import StaticFileHandler [as 别名]
# 或者: from tornado.web.StaticFileHandler import initialize [as 别名]
def initialize(self, path, default_filename=None):
StaticFileHandler.initialize(self, path, default_filename)
示例4: initialize
# 需要导入模块: from tornado.web import StaticFileHandler [as 别名]
# 或者: from tornado.web.StaticFileHandler import initialize [as 别名]
def initialize(self, path, default_filename=None, as_attachment=False, access_validation=None):
StaticFileHandler.initialize(self, path, default_filename)
self._as_attachment = as_attachment
self._access_validation = access_validation
示例5: initialize
# 需要导入模块: from tornado.web import StaticFileHandler [as 别名]
# 或者: from tornado.web.StaticFileHandler import initialize [as 别名]
def initialize(self):
StaticFileHandler.initialize(self, os.path.join(os.path.dirname(__file__), "data"))
示例6: initialize
# 需要导入模块: from tornado.web import StaticFileHandler [as 别名]
# 或者: from tornado.web.StaticFileHandler import initialize [as 别名]
def initialize(self, path, default_filename=None, as_attachment=False):
StaticFileHandler.initialize(self, path, default_filename)
self._as_attachment = as_attachment
示例7: initialize
# 需要导入模块: from tornado.web import StaticFileHandler [as 别名]
# 或者: from tornado.web.StaticFileHandler import initialize [as 别名]
def initialize(self, path, default_filename=None):
self._check_dir_(path)
StaticFileHandler.initialize(self, path, default_filename)
示例8: initialize
# 需要导入模块: from tornado.web import StaticFileHandler [as 别名]
# 或者: from tornado.web.StaticFileHandler import initialize [as 别名]
def initialize(self, path, default_filename=None, others=None):
StaticFileHandler.initialize(self, path, default_filename)
self._others = others if others else self.application.settings["static_handler_args"]["others"]
示例9: initialize
# 需要导入模块: from tornado.web import StaticFileHandler [as 别名]
# 或者: from tornado.web.StaticFileHandler import initialize [as 别名]
def initialize(self):
StaticFileHandler.initialize(self, UPLOAD_PATH)
示例10: initialize
# 需要导入模块: from tornado.web import StaticFileHandler [as 别名]
# 或者: from tornado.web.StaticFileHandler import initialize [as 别名]
def initialize(self):
StaticFileHandler.initialize(self,
self.controllers[Resource].styles_file_dir)