- l.start_tls_s();
- return l;
-
-# Function to prompt for a password
-def getpass(prompt = "Password: "):
- import termios, sys;
- fd = sys.stdin.fileno();
- old = termios.tcgetattr(fd);
- new = termios.tcgetattr(fd);
- new[3] = new[3] & ~termios.ECHO; # lflags
- try:
- termios.tcsetattr(fd, termios.TCSADRAIN, new);
- try:
- passwd = raw_input(prompt);
- except KeyboardInterrupt:
- termios.tcsetattr(fd, termios.TCSADRAIN, old);
- print
- sys.exit(0)
- except EOFError:
- passwd = ""
- finally:
- termios.tcsetattr(fd, termios.TCSADRAIN, old);
- print;
- return passwd;