From df85f3d7d754f44202bb92dc3e290cf2be550cfb Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Tue, 6 Sep 2011 17:07:05 -0400 Subject: remove unused chunksize --- pyramid/static.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/pyramid/static.py b/pyramid/static.py index e7d41630e..93d399f54 100644 --- a/pyramid/static.py +++ b/pyramid/static.py @@ -14,8 +14,6 @@ from pyramid.response import Response from pyramid.traversal import traversal_path from pyramid.traversal import quote_path_segment -DEFAULT_CHUNKSIZE = 1<<16 # 64 kilobytes - def init_mimetypes(mimetypes): # this is a function so it can be unittested if hasattr(mimetypes, 'init'): @@ -32,7 +30,7 @@ class FileResponse(Response): """ Serves a static filelike object. """ - def __init__(self, path, expires, chunksize=DEFAULT_CHUNKSIZE): + def __init__(self, path, expires): super(FileResponse, self).__init__(conditional_response=True) self.last_modified = datetime.fromtimestamp(getmtime(path), tz=UTC) self.date = datetime.utcnow() @@ -91,8 +89,7 @@ class static_view(object): FileResponse = FileResponse # override point def __init__(self, root_dir, cache_max_age=3600, package_name=None, - use_subpath=False, index='index.html', - chunksize=DEFAULT_CHUNKSIZE): + use_subpath=False, index='index.html'): # package_name is for bw compat; it is preferred to pass in a # package-relative path as root_dir # (e.g. ``anotherpackage:foo/static``). @@ -106,7 +103,6 @@ class static_view(object): self.package_name = package_name self.docroot = docroot self.norm_docroot = normcase(normpath(docroot)) - self.chunksize = chunksize self.index = index def __call__(self, context, request): @@ -145,7 +141,7 @@ class static_view(object): if not exists(filepath): return HTTPNotFound(request.url) - return self.FileResponse(filepath ,self.expires, self.chunksize) + return self.FileResponse(filepath ,self.expires) def add_slash_redirect(self, request): url = request.path_url + '/' -- cgit v1.2.3