From 98996c238cf50bc923b1de92c65de965e3e0c00f Mon Sep 17 00:00:00 2001 From: bwarsaw Date: Tue, 26 May 1998 18:45:14 +0000 Subject: 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. --- scripts/answer_majordomo_mail | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'scripts') 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') -- cgit v1.3.1