From: Eduardo Ramos Testillano Date: Fri, 20 Mar 2015 16:29:09 +0000 (+0100) Subject: Protection for non-interactive procedures X-Git-Tag: REFACTORING_TESTING_LIBRARY~219 X-Git-Url: https://git.teslayout.com/public/public/public/?a=commitdiff_plain;h=67212bbf2fdeaa702e607337c6277ddd03d7de61;p=anna.git Protection for non-interactive procedures --- diff --git a/SConstruct b/SConstruct index f5cde93..517b1a6 100644 --- a/SConstruct +++ b/SConstruct @@ -1,4 +1,5 @@ import os +import sys, select # Basic paths prefix = ARGUMENTS.get ('prefix', "/usr/local") @@ -23,7 +24,13 @@ rc = os.system("clang++ --version >/dev/null 2>/dev/null") if rc == 0: print "\nDetected clang++ installed in the system" print "\nSelect compiler:\n 1. g++\n 2. clang++" - option = raw_input("\nInput option [1]: ") or "1" + #option = raw_input("\nInput option [1]: ") or "1" + # Read with timeout: + print "\nInput option [1]: " + option = 1 + i, o, e = select.select( [sys.stdin], [], [], 60 ) + if (i): option = sys.stdin.readline().strip() + else: print "expired! using default ..." if option == "2": env = Environment(CXX = 'clang++') env.Append (CCFLAGS = '-DIS_CLANG')