prompts: fixed input() calls for python3
This commit is contained in:
parent
3424f9c3fc
commit
920327d224
3 changed files with 6 additions and 7 deletions
|
|
@ -276,7 +276,7 @@ class DbManage(object):
|
|||
email = defaults.get('email')
|
||||
|
||||
if username is None:
|
||||
username = eval(input('Specify admin username:'))
|
||||
username = input('Specify admin username:')
|
||||
if password is None:
|
||||
password = self._get_admin_password()
|
||||
if not password:
|
||||
|
|
@ -285,7 +285,7 @@ class DbManage(object):
|
|||
if not password:
|
||||
sys.exit()
|
||||
if email is None:
|
||||
email = eval(input('Specify admin email:'))
|
||||
email = input('Specify admin email:')
|
||||
api_key = self.cli_args.get('api_key')
|
||||
self.create_user(username, password, email, True,
|
||||
strict_creation_check=False,
|
||||
|
|
@ -524,10 +524,10 @@ class DbManage(object):
|
|||
if _path is not None:
|
||||
path = _path
|
||||
elif not self.tests and not test_repo_path:
|
||||
path = eval(input(
|
||||
path = input(
|
||||
'Enter a valid absolute path to store repositories. '
|
||||
'All repositories in that path will be added automatically:'
|
||||
))
|
||||
)
|
||||
else:
|
||||
path = test_repo_path
|
||||
path_ok = True
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@ from zope.interface import implementer
|
|||
from binascii import hexlify
|
||||
|
||||
|
||||
|
||||
class CustomSession(Session):
|
||||
pass
|
||||
|
||||
|
|
@ -109,7 +108,7 @@ def BeakerSessionFactoryConfig(**options):
|
|||
return storage
|
||||
|
||||
def peek_flash(self, queue=''):
|
||||
storage = self.get('_f_' + queue, [])
|
||||
storage = self.get(f'_f_{queue}', [])
|
||||
return storage
|
||||
|
||||
# CSRF API methods
|
||||
|
|
|
|||
|
|
@ -321,7 +321,7 @@ def is_valid_repo_group(repo_group_name, base_path, skip_path_check=False):
|
|||
|
||||
def ask_ok(prompt, retries=4, complaint='[y]es or [n]o please!'):
|
||||
while True:
|
||||
ok = eval(input(prompt))
|
||||
ok = input(prompt)
|
||||
if ok.lower() in ('y', 'ye', 'yes'):
|
||||
return True
|
||||
if ok.lower() in ('n', 'no', 'nop', 'nope'):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue