Mercurial > p > roundup > code
comparison roundup/configuration.py @ 3882:46ef2a6fd79d
config option to limit nosy attachments based on size
reworking of patch [SF#772323] from Philipp Gortan
It tries to avoid reading the file contents just to
get the file size but that was too hard for metakit backends.
They don't inherit from blobfiles.FileStorage which makes
it more challenging. Really that backend should be reworked
to inherit from FileStorage.
I'm not sure I like the default being sys.maxint. Maybe have
0 == unlimited? But what if someone really wanted to set it to
0 to mean "don't attach anything"?
| author | Justus Pendleton <jpend@users.sourceforge.net> |
|---|---|
| date | Mon, 03 Sep 2007 17:14:09 +0000 |
| parents | 454ee9411e85 |
| children | 6b3919328381 |
comparison
equal
deleted
inserted
replaced
| 3881:e7050411a774 | 3882:46ef2a6fd79d |
|---|---|
| 1 # Roundup Issue Tracker configuration support | 1 # Roundup Issue Tracker configuration support |
| 2 # | 2 # |
| 3 # $Id: configuration.py,v 1.46 2007-09-02 06:48:13 forsberg Exp $ | 3 # $Id: configuration.py,v 1.47 2007-09-03 17:14:08 jpend Exp $ |
| 4 # | 4 # |
| 5 __docformat__ = "restructuredtext" | 5 __docformat__ = "restructuredtext" |
| 6 | 6 |
| 7 import ConfigParser | 7 import ConfigParser |
| 8 import getopt | 8 import getopt |
| 742 (Option, "email_sending", "single", | 742 (Option, "email_sending", "single", |
| 743 "Controls the email sending from the nosy reactor. If\n" | 743 "Controls the email sending from the nosy reactor. If\n" |
| 744 "\"multiple\" then a separate email is sent to each\n" | 744 "\"multiple\" then a separate email is sent to each\n" |
| 745 "recipient. If \"single\" then a single email is sent with\n" | 745 "recipient. If \"single\" then a single email is sent with\n" |
| 746 "each recipient as a CC address."), | 746 "each recipient as a CC address."), |
| 747 (IntegerNumberOption, "max_attachment_size", sys.maxint, | |
| 748 "Attachments larger than the given number of bytes\n" | |
| 749 "won't be attached to nosy mails. They will be replaced by\n" | |
| 750 "a link to the tracker's download page for the file.") | |
| 747 ), "Nosy messages sending"), | 751 ), "Nosy messages sending"), |
| 748 ) | 752 ) |
| 749 | 753 |
| 750 ### Configuration classes | 754 ### Configuration classes |
| 751 | 755 |
