Mercurial > p > roundup > code
diff roundup/roundupdb.py @ 3941:9997b941dd6d
remove some metakit references
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Wed, 07 Nov 2007 20:47:12 +0000 |
| parents | 63ab356dfcf9 |
| children | bb2722260e47 |
line wrap: on
line diff
--- a/roundup/roundupdb.py Sun Nov 04 05:12:07 2007 +0000 +++ b/roundup/roundupdb.py Wed Nov 07 20:47:12 2007 +0000 @@ -16,7 +16,7 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -# $Id: roundupdb.py,v 1.134 2007-11-04 06:11:18 richard Exp $ +# $Id: roundupdb.py,v 1.135 2007-11-07 20:47:12 richard Exp $ """Extending hyperdb with types specific to issue-tracking. """ @@ -322,16 +322,9 @@ message_files = [] if msgid : for fileid in messages.get(msgid, 'files') : - # try to avoid reading in the file contents just to check the size - # backends that inherit from blobfiles.FileStorage have a filename class - if hasattr(self.db, 'filename'): - filename = self.db.filename('file', fileid, None) - filesize = os.path.getsize(filename) - else: - # metakit doesn't inherit from FileStorage so we read the - # full file contents to get the size :-/ - filesize = len(self.db.file.get(fileid, 'content')) - + # check the attachment size + filename = self.db.filename('file', fileid, None) + filesize = os.path.getsize(filename) if filesize <= self.db.config.NOSY_MAX_ATTACHMENT_SIZE: message_files.append(fileid) else:
