summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorklm1998-07-23 16:02:54 +0000
committerklm1998-07-23 16:02:54 +0000
commit9bfe3f7b70076b7d932d9057c1884acdfcb64288 (patch)
treeba76042023dc38875109af4c04c9e8328cc14c6c
parent79a2de5e55c61d2db609631db2e3ab800fb49a11 (diff)
downloadmailman-9bfe3f7b70076b7d932d9057c1884acdfcb64288.tar.gz
mailman-9bfe3f7b70076b7d932d9057c1884acdfcb64288.tar.zst
mailman-9bfe3f7b70076b7d932d9057c1884acdfcb64288.zip
With recent maketext() (wrap()) fixes, we can just append the list of
pending items to the message after formatting, rather than the more complicated literal inclusion of a format string that was being used. Added a '-v' option to the script, to get verbose operation for debugging.
-rwxr-xr-xcron/checkdbs9
1 files changed, 6 insertions, 3 deletions
diff --git a/cron/checkdbs b/cron/checkdbs
index 162683ba0..1ec839ed4 100755
--- a/cron/checkdbs
+++ b/cron/checkdbs
@@ -24,11 +24,13 @@ from Mailman import MailList
from Mailman import mm_cfg
from Mailman import Utils
-def main():
+def main(verbose=0):
for name in Utils.list_names():
list = MailList.MailList(name, lock = 0)
count = list.NumRequestsPending()
+ if verbose:
+ print name, count, list.GetAdminEmail()
if count:
text = Utils.maketext('checkdbs.txt',
{'count': count,
@@ -40,7 +42,7 @@ def main():
list.SendTextToUser(subject = '%d %s admin request(s) waiting' %
(count, list.real_name),
recipient = list.GetAdminEmail(),
- text = text % pending_requests(list))
+ text = text + "\n" + pending_requests(list))
def pending_requests(list):
import time, string
@@ -67,4 +69,5 @@ def pending_requests(list):
return string.join(pending, '\n')
if __name__ == "__main__":
- main()
+ main(verbose=(len(sys.argv) > 1
+ and sys.argv[1] in ["-v", "--verbose"]))