Commit 4c27c715 authored by Nicola Spanti's avatar Nicola Spanti
Browse files

[py3] Fix call to `raw_input` that does not exist anymore

https://stackoverflow.com/questions/954834/how-do-i-use-raw-input-in-python-3

--HG--
branch : 3.26
parent b474b5b08a24
Pipeline #50862 passed with stage
in 39 seconds
......@@ -52,6 +52,8 @@ from getpass import getpass
from os.path import basename
from time import clock
from six.moves import input
from logilab.common.fileutils import lines
from logilab.common.ureports import Table, TextWriter
......@@ -164,7 +166,7 @@ def run(args):
usage(1)
queries = [query for query in lines(args[1]) if not query.startswith('#')]
if user is None:
user = raw_input('login: ')
user = input('login: ')
if password is None:
password = getpass('password: ')
from cubicweb.cwconfig import instance_configuration
......
from six.moves import input
if confirm('use Europe/Paris as timezone?'):
timezone = 'Europe/Paris'
else:
import pytz
while True:
timezone = raw_input('enter your timezone')
timezone = input('enter your timezone')
if timezone in pytz.common_timezones:
break
......
......@@ -19,6 +19,8 @@
import sys
import getpass
from six.moves import input
from cubicweb import Binary
from cubicweb.server.utils import crypt_password
......@@ -26,7 +28,7 @@ from cubicweb.server.utils import crypt_password
if __args__:
login = __args__.pop()
else:
login = raw_input("login? ")
login = input("login? ")
rset = rql('Any U WHERE U is CWUser, U login %(login)s', {'login': login})
......
from __future__ import print_function
from six.moves import input
from base64 import b64decode, b64encode
try:
......@@ -12,7 +13,7 @@ olddn = repo.source_by_uri(uri).config['user-base-dn']
assert olddn != newdn
raw_input("Ensure you've stopped the instance, type enter when done.")
input("Ensure you've stopped the instance, type enter when done.")
for eid, olduserdn in rql("Any X, XURI WHERE X cwuri XURI, X cw_source S, S name %(name)s",
{'name': uri}):
......
......@@ -23,7 +23,7 @@ import json
import sys
import sqlite3
from six import PY2, text_type, string_types
from six import PY2, text_type, string_types, input
from logilab.common.shellutils import ProgressBar, DummyProgressBar
......@@ -58,7 +58,7 @@ def group_mapping(cnx, interactive=True):
print('or just type enter to skip permissions granted to a group')
for group in missing:
while True:
value = raw_input('eid for group %s: ' % group).strip()
value = input('eid for group %s: ' % group).strip()
if not value:
continue
try:
......
......@@ -24,13 +24,14 @@ rename A010-joe.en.txt to A030-joe.en.txt
accept [y/N]?
"""
from __future__ import print_function
from six.moves import input
def ren(a,b):
names = glob.glob('%s*'%a)
for name in names :
print('rename %s to %s' % (name, name.replace(a,b)))
if raw_input('accept [y/N]?').lower() =='y':
if input('accept [y/N]?').lower() =='y':
for name in names:
os.system('hg mv %s %s' % (name, name.replace(a,b)))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment