mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
py3 porting cleanup: drop raw_input compat alias
This commit is contained in:
parent
887f620406
commit
e592d895ea
@ -6,7 +6,6 @@
|
||||
import sys
|
||||
from calibre import prints
|
||||
from calibre.db.legacy import LibraryDatabase
|
||||
from polyglot.builtins import raw_input
|
||||
|
||||
readonly = False
|
||||
version = 0 # change this if you change signature of implementation()
|
||||
@ -39,7 +38,7 @@ columns with the custom_columns command.
|
||||
|
||||
|
||||
def input_unicode(prompt):
|
||||
ans = raw_input(prompt)
|
||||
ans = input(prompt)
|
||||
if isinstance(ans, bytes):
|
||||
ans = ans.decode(sys.stdin.encoding)
|
||||
return ans
|
||||
|
@ -12,7 +12,7 @@ from calibre.utils.config import OptionParser
|
||||
from calibre.constants import iswindows
|
||||
from calibre import prints
|
||||
from calibre.startup import get_debug_executable
|
||||
from polyglot.builtins import exec_path, raw_input, unicode_type, getcwd
|
||||
from polyglot.builtins import exec_path, unicode_type, getcwd
|
||||
|
||||
|
||||
def run_calibre_debug(*args, **kw):
|
||||
@ -156,7 +156,7 @@ def debug_device_driver():
|
||||
from calibre.devices import debug
|
||||
debug(ioreg_to_tmp=True, buf=sys.stdout)
|
||||
if iswindows: # no2to3
|
||||
raw_input('Press Enter to continue...') # no2to3
|
||||
input('Press Enter to continue...') # no2to3
|
||||
|
||||
|
||||
def add_simple_plugin(path_to_plugin):
|
||||
|
@ -12,7 +12,6 @@
|
||||
# #
|
||||
#########################################################################
|
||||
import sys, os
|
||||
from polyglot.builtins import raw_input
|
||||
from . import open_for_read, open_for_write
|
||||
# , codecs
|
||||
|
||||
@ -84,7 +83,7 @@ class Output:
|
||||
msg += ('Type "o" to overwrite.\n'
|
||||
'Type any other key to print to standard output.\n')
|
||||
sys.stderr.write(msg)
|
||||
user_response = raw_input()
|
||||
user_response = input()
|
||||
if user_response == 'o':
|
||||
with open_for_read(self.__file) as read_obj:
|
||||
with open_for_write(self.output_file) as write_obj:
|
||||
|
@ -8,7 +8,7 @@ from functools import partial
|
||||
from calibre import prints
|
||||
from calibre.constants import preferred_encoding, iswindows
|
||||
from calibre.utils.config import OptionParser
|
||||
from polyglot.builtins import iteritems, raw_input, unicode_type
|
||||
from polyglot.builtins import iteritems, unicode_type
|
||||
|
||||
|
||||
def create_subcommand_parser(name, usage):
|
||||
@ -102,7 +102,7 @@ def manage_users_cli(path=None, args=()):
|
||||
|
||||
def get_input(prompt):
|
||||
prints(prompt, end=' ')
|
||||
ans = raw_input()
|
||||
ans = input()
|
||||
if isinstance(ans, bytes):
|
||||
ans = ans.decode(enc)
|
||||
if iswindows:
|
||||
|
@ -11,7 +11,7 @@ from calibre.constants import config_dir, iswindows, filesystem_encoding
|
||||
from calibre.utils.config_base import prefs, StringConfig, create_global_prefs
|
||||
from calibre.utils.config import JSONConfig
|
||||
from calibre.utils.filenames import samefile
|
||||
from polyglot.builtins import iteritems, raw_input, error_message, unicode_type
|
||||
from polyglot.builtins import iteritems, error_message, unicode_type
|
||||
from polyglot.binary import as_hex_unicode
|
||||
|
||||
|
||||
@ -389,7 +389,7 @@ def cli_report(*args, **kw):
|
||||
|
||||
|
||||
def input_unicode(prompt):
|
||||
ans = raw_input(prompt)
|
||||
ans = input(prompt)
|
||||
if isinstance(ans, bytes):
|
||||
ans = ans.decode(sys.stdin.encoding)
|
||||
return ans
|
||||
|
@ -16,7 +16,7 @@ from itertools import islice
|
||||
from calibre import detect_ncpus as cpu_count, as_unicode
|
||||
from calibre.constants import filesystem_encoding
|
||||
from calibre.utils.icu import primary_sort_key, primary_find, primary_collator
|
||||
from polyglot.builtins import iteritems, itervalues, unicode_type, raw_input, getcwd
|
||||
from polyglot.builtins import iteritems, itervalues, unicode_type, getcwd
|
||||
from polyglot.queue import Queue
|
||||
|
||||
DEFAULT_LEVEL1 = '/'
|
||||
@ -328,7 +328,7 @@ def get_char(string, pos):
|
||||
|
||||
|
||||
def input_unicode(prompt):
|
||||
ans = raw_input(prompt)
|
||||
ans = input(prompt)
|
||||
if isinstance(ans, bytes):
|
||||
ans = ans.decode(sys.stdin.encoding)
|
||||
return ans
|
||||
|
Loading…
x
Reference in New Issue
Block a user