本文整理汇总了Python中twisted.web.static.File.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python File.__init__方法的具体用法?Python File.__init__怎么用?Python File.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类twisted.web.static.File
的用法示例。
在下文中一共展示了File.__init__方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from twisted.web.static import File [as 别名]
# 或者: from twisted.web.static.File import __init__ [as 别名]
def __init__(self, pdfpath, cacheroot):
self.pdf = Pdf(pdfpath)
self.cacheroot = cacheroot
if not os.path.exists(cacheroot):
os.makedirs(cacheroot)
File.__init__(self, pdfpath)
示例2: __init__
# 需要导入模块: from twisted.web.static import File [as 别名]
# 或者: from twisted.web.static.File import __init__ [as 别名]
def __init__(self, bucket, path, defaultType="text/html", ignoredExts=(),
registry=None, allowExt=0, pwdic=None):
# print "Instantiating WebDAV instance:", path
File.__init__(self, path, defaultType=defaultType,
ignoredExts=ignoredExts, registry=registry,
allowExt=allowExt)
self.path = path
self.pwdic = pwdic
self.s3 = boto.connect_s3()
self.bucket = self.s3.get_bucket(bucket)
self.mapper = S3ObjectMapper()
示例3: __init__
# 需要导入模块: from twisted.web.static import File [as 别名]
# 或者: from twisted.web.static.File import __init__ [as 别名]
def __init__(self, *args, **kwargs):
self._cache_timeout = kwargs.pop('cache_timeout', None)
File.__init__(self, *args, **kwargs)
示例4: __init__
# 需要导入模块: from twisted.web.static import File [as 别名]
# 或者: from twisted.web.static.File import __init__ [as 别名]
def __init__(self, path, site):
File.__init__(self, path)
self.path = path
self.site = site
self.not_found_resource = NotFoundResource(self.site)
示例5: __init__
# 需要导入模块: from twisted.web.static import File [as 别名]
# 或者: from twisted.web.static.File import __init__ [as 别名]
def __init__(self, *args, **kwargs):
File.__init__(self, *args, **kwargs)
if not exists(self.path):
raise OSError("%s does not exist" % self.path)
示例6: __init__
# 需要导入模块: from twisted.web.static import File [as 别名]
# 或者: from twisted.web.static.File import __init__ [as 别名]
def __init__(self, path, config, **kwargs):
File.__init__(self, path, **kwargs)
directory = config.get('directory', '')
file = config.get('options', {}).get('default_file')
self.path = os.path.join(directory, file)
示例7: __init__
# 需要导入模块: from twisted.web.static import File [as 别名]
# 或者: from twisted.web.static.File import __init__ [as 别名]
def __init__(self, kid, path, **kw):
self.kid = kid
File.__init__(self, path, **kw)
示例8: __init__
# 需要导入模块: from twisted.web.static import File [as 别名]
# 或者: from twisted.web.static.File import __init__ [as 别名]
def __init__(self, path, defaultType="text/html", ignoredExts=(), registry=None, allowExt=0):
File.__init__(self,path, defaultType,ignoredExts,registry,allowExt)
示例9: __init__
# 需要导入模块: from twisted.web.static import File [as 别名]
# 或者: from twisted.web.static.File import __init__ [as 别名]
def __init__(self,*args):
File.__init__(self,*args)
示例10: __init__
# 需要导入模块: from twisted.web.static import File [as 别名]
# 或者: from twisted.web.static.File import __init__ [as 别名]
def __init__(self, *args, **kwargs):
self._cache_timeout = kwargs.pop('cache_timeout', None)
self._allow_cross_origin = kwargs.pop('allow_cross_origin', True)
File.__init__(self, *args, **kwargs)
示例11: __init__
# 需要导入模块: from twisted.web.static import File [as 别名]
# 或者: from twisted.web.static.File import __init__ [as 别名]
def __init__(self, *args, **kwargs):
File.__init__(self, *args, **kwargs)
self.processors = {'.html': self._processTemplate}
self.renderers = {}
示例12: __init__
# 需要导入模块: from twisted.web.static import File [as 别名]
# 或者: from twisted.web.static.File import __init__ [as 别名]
def __init__(self, path, *args, **kwargs):
File.__init__(self, path, *args, **kwargs)
self.path = path