diff options
author | ianb <devnull@localhost> | 2007-02-19 00:04:47 +0000 |
---|---|---|
committer | ianb <devnull@localhost> | 2007-02-19 00:04:47 +0000 |
commit | 13f2b58b6f8d9695522137b759c7a5d1dcd356b3 (patch) | |
tree | b888c00306da9affc2c2b7a1b009340e7686ad27 /paste/fileapp.py | |
parent | 1cf4f03c6a0347ea8bf64b8b6e1f7c72572a33c8 (diff) | |
download | paste-13f2b58b6f8d9695522137b759c7a5d1dcd356b3.tar.gz |
make guess_type overridable
Diffstat (limited to 'paste/fileapp.py')
-rw-r--r-- | paste/fileapp.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/paste/fileapp.py b/paste/fileapp.py index dce8780..a2c1413 100644 --- a/paste/fileapp.py +++ b/paste/fileapp.py @@ -169,13 +169,16 @@ class FileApp(DataApp): def __init__(self, filename, headers=None, **kwargs): self.filename = filename - content_type, content_encoding = mimetypes.guess_type(self.filename) + content_type, content_encoding = self.guess_type() if content_type and 'content_type' not in kwargs: kwargs['content_type'] = content_type if content_encoding and 'content_encoding' not in kwargs: kwargs['content_encoding'] = content_encoding DataApp.__init__(self, None, headers, **kwargs) + def guess_type(self): + return mimetypes.guess_type(self.filename) + def update(self, force=False): stat = os.stat(self.filename) if not force and stat.st_mtime == self.last_modified: |