提交 58afa121 编写于 作者: J James Troup

add optional prompt argument to our_raw_input; use it.

上级 a62fdf55
......@@ -2,7 +2,7 @@
# Checks Debian packages from Incoming
# Copyright (C) 2000, 2001 James Troup <james@nocrew.org>
# $Id: jennifer,v 1.6 2002-02-22 01:20:12 troup Exp $
# $Id: jennifer,v 1.7 2002-02-22 02:19:26 troup Exp $
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
......@@ -44,7 +44,7 @@ re_is_changes = re.compile (r"(.+?)_(.+?)_(.+?)\.changes$");
################################################################################
# Globals
jennifer_version = "$Revision: 1.6 $";
jennifer_version = "$Revision: 1.7 $";
Cnf = None;
Options = None;
......@@ -942,12 +942,11 @@ def action ():
answer = 'A';
while string.find(prompt, answer) == -1:
print prompt,;
answer = utils.our_raw_input()
m = katie.re_default_answer.match(prompt)
answer = utils.our_raw_input(prompt);
m = katie.re_default_answer.match(prompt);
if answer == "":
answer = m.group(1)
answer = string.upper(answer[:1])
answer = m.group(1);
answer = string.upper(answer[:1]);
if answer == 'R':
os.chdir (pkg.directory);
......
......@@ -2,7 +2,7 @@
# Installs Debian packages
# Copyright (C) 2000, 2001 James Troup <james@nocrew.org>
# $Id: katie,v 1.70 2002-02-13 02:38:53 troup Exp $
# $Id: katie,v 1.71 2002-02-22 02:19:26 troup Exp $
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
......@@ -39,7 +39,7 @@ import db_access, katie, logging, utils;
###############################################################################
# Globals
katie_version = "$Revision: 1.70 $";
katie_version = "$Revision: 1.71 $";
Cnf = None;
Options = None;
......@@ -196,12 +196,11 @@ def action ():
answer = 'I';
while string.find(prompt, answer) == -1:
print prompt,;
answer = utils.our_raw_input()
m = katie.re_default_answer.match(prompt)
answer = utils.our_raw_input(prompt);
m = katie.re_default_answer.match(prompt);
if answer == "":
answer = m.group(1)
answer = string.upper(answer[:1])
answer = m.group(1);
answer = string.upper(answer[:1]);
if answer == 'R':
do_reject ();
......
......@@ -2,7 +2,7 @@
# General purpose package removal tool for ftpmaster
# Copyright (C) 2000, 2001 James Troup <james@nocrew.org>
# $Id: melanie,v 1.22 2002-02-12 22:14:38 troup Exp $
# $Id: melanie,v 1.23 2002-02-22 02:19:26 troup Exp $
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
......@@ -82,8 +82,7 @@ ARCH, BUG#, COMPONENT and SUITE can be space seperated lists, e.g.
# going to do now?"
def game_over():
print "Continue (y/N)? ",
answer = string.lower(utils.our_raw_input());
answer = string.lower(utils.our_raw_input("Continue (y/N)? "));
if answer != "y":
print "Aborted."
sys.exit(1);
......@@ -395,7 +394,7 @@ def main ():
Subst["__BCC__"] = "Bcc: " + string.join(bcc, ", ");
else:
Subst["__BCC__"] = "X-Filler: 42";
Subst["__CC__"] = "X-Melanie: $Revision: 1.22 $";
Subst["__CC__"] = "X-Melanie: $Revision: 1.23 $";
if carbon_copy:
Subst["__CC__"] = Subst["__CC__"] + "\nCc: " + string.join(carbon_copy, ", ");
Subst["__SUITE_LIST__"] = suites_list;
......
# Utility functions
# Copyright (C) 2000, 2001 James Troup <james@nocrew.org>
# $Id: utils.py,v 1.38 2002-02-12 23:15:23 troup Exp $
# $Id: utils.py,v 1.39 2002-02-22 02:19:26 troup Exp $
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
......@@ -63,15 +63,16 @@ def touch_file(filename):
######################################################################################
# From reportbug
def our_raw_input():
sys.stdout.flush()
def our_raw_input(prompt=""):
if prompt:
sys.stdout.write(prompt);
sys.stdout.flush();
try:
ret = raw_input()
ret = raw_input();
return ret
except EOFError:
sys.stderr.write('\nUser interrupt (^D).\n')
raise SystemExit
sys.stderr.write('\nUser interrupt (^D).\n');
raise SystemExit;
######################################################################################
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册