+def prod_maintainer ():
+ # Here we prepare an editor and get them ready to prod...
+ temp_filename = utils.temp_filename();
+ editor = os.environ.get("EDITOR","vi")
+ answer = 'E';
+ while answer == 'E':
+ os.system("%s %s" % (editor, temp_filename))
+ file = utils.open_file(temp_filename);
+ prod_message = "".join(file.readlines());
+ file.close();
+ print "Prod message:";
+ print utils.prefix_multi_line_string(prod_message," ",include_blank_lines=1);
+ prompt = "[P]rod, Edit, Abandon, Quit ?"
+ answer = "XXX";
+ while prompt.find(answer) == -1:
+ answer = utils.our_raw_input(prompt);
+ m = katie.re_default_answer.search(prompt);
+ if answer == "":
+ answer = m.group(1);
+ answer = answer[:1].upper();
+ os.unlink(temp_filename);
+ if answer == 'A':
+ return;
+ elif answer == 'Q':
+ sys.exit(0);
+ # Otherwise, do the proding...
+ user_email_address = utils.whoami() + " <%s>" % (
+ Cnf["Dinstall::MyAdminAddress"]);
+
+ Subst = Katie.Subst;
+
+ Subst["__FROM_ADDRESS__"] = user_email_address;
+ Subst["__PROD_MESSAGE__"] = prod_message;
+ Subst["__CC__"] = "Cc: " + Cnf["Dinstall::MyEmailAddress"];
+
+ prod_mail_message = utils.TemplateSubst(
+ Subst,Cnf["Dir::Templates"]+"/lisa.prod");
+
+ # Send the prod mail if appropriate
+ if not Cnf["Dinstall::Options::No-Mail"]:
+ utils.send_mail(prod_mail_message);
+
+ print "Sent proding message";
+
+################################################################################
+