For Python 2.7, raw_input is needed to request input; also ensure that

sample parameters are saved once requested.
This commit is contained in:
Anthony Tuininga 2019-03-29 09:49:40 -06:00
parent f324757909
commit 8681366f53
2 changed files with 13 additions and 0 deletions

View File

@ -43,6 +43,12 @@ import getpass
import os import os
import sys import sys
# for Python 2.7 we need raw_input
try:
input = raw_input
except NameError:
pass
# default values # default values
DEFAULT_MAIN_USER = "pythondemo" DEFAULT_MAIN_USER = "pythondemo"
DEFAULT_EDITION_USER = "pythoneditions" DEFAULT_EDITION_USER = "pythoneditions"
@ -70,6 +76,7 @@ def GetValue(name, label, defaultValue=""):
value = getpass.getpass(label) value = getpass.getpass(label)
if not value: if not value:
value = defaultValue value = defaultValue
PARAMETERS[name] = value
return value return value
def GetMainUser(): def GetMainUser():

View File

@ -49,6 +49,12 @@ import os
import sys import sys
import unittest import unittest
# for Python 2.7 we need raw_input
try:
input = raw_input
except NameError:
pass
# default values # default values
DEFAULT_MAIN_USER = "pythontest" DEFAULT_MAIN_USER = "pythontest"
DEFAULT_PROXY_USER = "pythontestproxy" DEFAULT_PROXY_USER = "pythontestproxy"