equal
deleted
inserted
replaced
24 import sys |
24 import sys |
25 import logging |
25 import logging |
26 from threading import Thread |
26 from threading import Thread |
27 from getpass import getpass |
27 from getpass import getpass |
28 |
28 |
29 from six import PY2 |
29 from six import PY2, text_type |
30 from six.moves import input |
30 from six.moves import input |
31 |
31 |
32 from passlib.utils import handlers as uh, to_hash_str |
32 from passlib.utils import handlers as uh, to_hash_str |
33 from passlib.context import CryptContext |
33 from passlib.context import CryptContext |
34 |
34 |
104 if msg: |
104 if msg: |
105 print(msg) |
105 print(msg) |
106 while not user: |
106 while not user: |
107 user = input('login: ') |
107 user = input('login: ') |
108 if PY2: |
108 if PY2: |
109 user = unicode(user, sys.stdin.encoding) |
109 user = text_type(user, sys.stdin.encoding) |
110 passwd = getpass('%s: ' % passwdmsg) |
110 passwd = getpass('%s: ' % passwdmsg) |
111 if confirm: |
111 if confirm: |
112 while True: |
112 while True: |
113 passwd2 = getpass('confirm password: ') |
113 passwd2 = getpass('confirm password: ') |
114 if passwd == passwd2: |
114 if passwd == passwd2: |