ACC SHELL

Path : /usr/lib/python/
File Upload :
Current File : //usr/lib/python/getpass.pyo

Ńņ
nÄMc	@s?dZddkZddkZddkZdddgZdefd„ƒYZddd„Zddd	„Z	ddd
„Z
dddd„Zd
„Zy ddk
Z
e
ie
ifWn{eefj
oiyddkZWnIej
o=yddklZWnej
o
e
Zq0XeZq;Xe	ZnXeZdS(sĮUtilities to get a password and/or the current user name.

getpass(prompt[, stream]) - Prompt for a password, with echo turned off.
getuser() - Get the user name from the environment or password database.

GetPassWarning - This UserWarning is issued when getpass() cannot prevent
                 echoing of the password contents while reading.

On Windows, the msvcrt module will be used.
On the Mac EasyDialogs.AskPassword is used, if available.

i’’’’NtgetpasstgetusertGetPassWarningcBseZRS((t__name__t
__module__(((s/usr/lib/python2.6/getpass.pyRss
Password: c
CsŃd}d}yLtidtitiBƒ}ti|ddƒ}|}|p
|}nWn^tj
oR}ytii	ƒ}Wnt
||ƒ}nXti}|p
ti}q¹nX|dj	ośd}y¬ti
|ƒ}|}|dctitiBM<ti}	ttdƒo|	tiO}	nz,ti||	|ƒt||d|ƒ}Wdti||	|ƒ|iƒXWqĄtij
o2}|dj	o‚n~~t
||ƒ}qĄXn|idƒ|S(	sPrompt for a password, with echo turned off.

    Args:
      prompt: Written on stream to ask for the input.  Default: 'Password: '
      stream: A writable file object to display the prompt.  Defaults to
              the tty.  If no tty is available defaults to sys.stderr.
    Returns:
      The seKr3t input.
    Raises:
      EOFError: If our input tty or stdin was closed.
      GetPassWarning: When we were unable to turn echo off on the input.

    Always restores terminal settings before returning.
    s/dev/ttysw+iitTCSASOFTtinputNs
(tNonetostopentO_RDWRtO_NOCTTYtfdopentEnvironmentErrortsyststdintfilenotfallback_getpasststderrttermiost	tcgetattrtECHOtISIGt	TCSAFLUSHthasattrRt	tcsetattrt
_raw_inputtflushterrortwrite(
tprompttstreamtfdtttyRtetpasswdtoldtnewttcsetattr_flags((s/usr/lib/python2.6/getpass.pytunix_getpasssJ	
	

cCsÜtitij	ot||ƒSddk}x|D]}|i|ƒq4Wd}xj|iƒ}|djp
|djoPn|djo
t‚n|djo|d }qT||}qT|idƒ|idƒ|S(s9Prompt for password with echo off, using Windows getch().i’’’’Nts
s
ss(RRt	__stdin__RtmsvcrttputchtgetchtKeyboardInterrupt(RRR*tctpw((s/usr/lib/python2.6/getpass.pytwin_getpassYs&





cCsAtidtddƒ|p
ti}n|dIJt||ƒS(Ns%Can not control echo on the terminal.t
stacklevelis&Warning: Password input may be echoed.(twarningstwarnRRRR(RR((s/usr/lib/python2.6/getpass.pyRps

R(cCs–|p
ti}n|p
ti}nt|ƒ}|o|i|ƒ|iƒn|iƒ}|p
t‚n|ddjo|d }n|S(Ni’’’’s
(RRRtstrRRtreadlinetEOFError(RRRtline((s/usr/lib/python2.6/getpass.pyRys



cCs^ddk}x,dD]$}|ii|ƒ}|o|SqWddk}|i|iƒƒdS(	sĀGet the username from the environment or password database.

    First try various environment variables, then the password
    database.  This works on Windows as long as USERNAME is set.

    i’’’’NtLOGNAMEtUSERtLNAMEtUSERNAMEi(R8R9R:R;(Rtenvirontgettpwdtgetpwuidtgetuid(RtnametuserR>((s/usr/lib/python2.6/getpass.pyRs	(tAskPassword(t__doc__RRR2t__all__tUserWarningRRR'R0RRRRRRtImportErrortAttributeErrorR*tEasyDialogsRCR(((s/usr/lib/python2.6/getpass.pyt<module>s,$?		

ACC SHELL 2018