10 getuser() - get the user name from the environment or password database |
10 getuser() - get the user name from the environment or password database |
11 |
11 |
12 This module is a replacement for the one found in the Python distribution. It |
12 This module is a replacement for the one found in the Python distribution. It |
13 is to provide a debugger compatible variant of the a.m. functions. |
13 is to provide a debugger compatible variant of the a.m. functions. |
14 """ |
14 """ |
15 |
|
16 import sys |
|
17 |
15 |
18 __all__ = ["getpass", "getuser"] |
16 __all__ = ["getpass", "getuser"] |
19 |
17 |
20 def getuser(): |
18 def getuser(): |
21 """ |
19 """ |
44 Function to prompt for a password, with echo turned off. |
42 Function to prompt for a password, with echo turned off. |
45 |
43 |
46 @param prompt Prompt to be shown to the user (string) |
44 @param prompt Prompt to be shown to the user (string) |
47 @return Password entered by the user (string) |
45 @return Password entered by the user (string) |
48 """ |
46 """ |
49 return raw_input(prompt, 0) |
47 return input(prompt, False) |
50 |
48 |
51 unix_getpass = getpass |
49 unix_getpass = getpass |
52 win_getpass = getpass |
50 win_getpass = getpass |
53 default_getpass = getpass |
51 default_getpass = getpass |