diff --git a/py/Boinc/tools.py b/py/Boinc/tools.py index 8cc9489069..3e3df4b77d 100644 --- a/py/Boinc/tools.py +++ b/py/Boinc/tools.py @@ -62,21 +62,15 @@ def file_size(path): f.seek(0,2) return f.tell() -def query_yesno(question): +def query_yesno(str): '''Query user; default Yes''' - valid = ('yes', 'y', '') - choice = input(question + "[Y/n] ").lower() - if choice in valid: - return True - return False + print str, "[Y/n] ", + return not raw_input().strip().lower().startswith('n') -def query_noyes(question): +def query_noyes(str): '''Query user; default No''' - valid = ('yes', 'y') - choice = input(question + "[y/N] ").lower() - if choice in valid: - return True - return False + print str, "[y/N] ", + return raw_input().strip().lower().startswith('y') def get_output_file_path(filename): """ Return the filename's path in the upload directory diff --git a/tools/make_project b/tools/make_project index bcf4881357..2d1592b8f3 100755 --- a/tools/make_project +++ b/tools/make_project @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/env python # $Id$ # Creates a new BOINC project. diff --git a/tools/upgrade b/tools/upgrade index 90e9870b2a..8649250324 100755 --- a/tools/upgrade +++ b/tools/upgrade @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/env python # $Id$