summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbwarsaw1998-05-26 18:45:14 +0000
committerbwarsaw1998-05-26 18:45:14 +0000
commit98996c238cf50bc923b1de92c65de965e3e0c00f (patch)
treed061dc9895cb21a3678c629f6adbb65a52da872e
parentba5edfd18da410c0391582e7f66ea7dade171bb7 (diff)
downloadmailman-98996c238cf50bc923b1de92c65de965e3e0c00f.tar.gz
mailman-98996c238cf50bc923b1de92c65de965e3e0c00f.tar.zst
mailman-98996c238cf50bc923b1de92c65de965e3e0c00f.zip
1. Use the standard Python invocation #! line to get the interpreter
from $PATH 2. Do no direct sys.path munging in this file. Import the `paths' module, which is created during the configure process, and which performs all necessary path munging (and exports some useful variables too). 3. Remove RCS crud Also, calculate path to majordomo.answer.txt file using paths.prefix as the path base.
-rwxr-xr-xscripts/answer_majordomo_mail12
1 files changed, 7 insertions, 5 deletions
diff --git a/scripts/answer_majordomo_mail b/scripts/answer_majordomo_mail
index 0c0ffc82a..661de57fb 100755
--- a/scripts/answer_majordomo_mail
+++ b/scripts/answer_majordomo_mail
@@ -1,4 +1,5 @@
-#!/usr/local/bin/python
+#! /usr/bin/env python
+#
# Copyright (C) 1998 by the Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or
@@ -14,13 +15,13 @@
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
+
# This is another script that's really just for my use, but
# feel free to use it if you know how...
import sys
-
-sys.path.append('/home/mailman/mailman/modules')
+import os
+import paths
import mm_message, mm_utils
try:
@@ -31,6 +32,7 @@ except IOError:
pass # Oh well - SOL on redirect, errors show thru.
msg = mm_message.IncomingMessage()
-text = open('/home/mailman/mailman/misc/majordomo.answer.txt', 'r').read()
+txtfile = os.path.join(paths.prefix, 'misc/majordomo.answer.txt')
+text = open(txtfile, 'r').read()
mm_utils.SendTextToUser('Your mail to Majordomo...', text, msg.GetSender(),
'mailman-owner')