Lines Matching refs:filename
31 ... def __init__(self, filename):
32 ... self.filename = filename
34 ... res = make_response(self.filename)
37 >>> def get_mimetype(filename):
38 ... type, encoding = mimetypes.guess_type(filename)
47 >>> def make_response(filename):
48 ... res = Response(content_type=get_mimetype(filename))
49 ... res.body = open(filename, 'rb').read()
75 ... def __init__(self, filename):
76 ... self.filename = filename
78 ... return FileIterator(self.filename)
81 ... def __init__(self, filename):
82 ... self.filename = filename
83 ... self.fileobj = open(self.filename, 'rb')
92 >>> def make_response(filename):
93 ... res = Response(content_type=get_mimetype(filename))
94 ... res.app_iter = FileIterable(filename)
95 ... res.content_length = os.path.getsize(filename)
116 >>> def make_response(filename):
117 ... res = Response(content_type=get_mimetype(filename),
119 ... res.app_iter = FileIterable(filename)
120 ... res.content_length = os.path.getsize(filename)
121 ... res.last_modified = os.path.getmtime(filename)
122 ... res.etag = '%s-%s-%s' % (os.path.getmtime(filename),
123 ... os.path.getsize(filename), hash(filename))
164 ... def __init__(self, filename, start=None, stop=None):
165 ... self.filename = filename
169 ... return FileIterator(self.filename, self.start, self.stop)
171 ... return self.__class__(self.filename, start, stop)
174 ... def __init__(self, filename, start, stop):
175 ... self.filename = filename
176 ... self.fileobj = open(self.filename, 'rb')