o ÞñÐaÏã@s2dZddlZddlmZmZmZGdd„dƒZdS)a‚ urllib2.HTTPPasswordMgr object using the keyring, for use with the urllib2.HTTPBasicAuthHandler. usage: import urllib2 handlers = [urllib2.HTTPBasicAuthHandler(PasswordMgr())] urllib2.install_opener(handlers) urllib2.urlopen(...) This will prompt for a password if one is required and isn't already in the keyring. Then, it adds it to the keyring for subsequent use. éNé)Ú get_passwordÚdelete_passwordÚ set_passwordc@s,eZdZdd„Zdd„Zdd„Zdd„Zd S) Ú PasswordMgrcCst ¡S©N)ÚgetpassÚgetuser)ÚselfÚrealmÚauthuri©r ú./usr/lib/python3/dist-packages/keyring/http.pyÚ get_usernameszPasswordMgr.get_usernamecCs| ||¡}t|||ƒdSr)rr)r r r ÚpasswordÚuserr r rÚ add_passwords zPasswordMgr.add_passwordcCsF| ||¡}t||ƒ}|durdtƒ}t |¡}t|||ƒ||fS)Nz1password for %(user)s@%(realm)s for %(authuri)s: )rrÚvarsrr)r r r rrÚpromptr r rÚfind_user_passwords     zPasswordMgr.find_user_passwordcCs| ||¡}t||ƒdSr)rr)r r r rr r rÚclear_password%s zPasswordMgr.clear_passwordN)Ú__name__Ú __module__Ú __qualname__rrrrr r r rrs  r)Ú__doc__rÚrrrrr r r rÚs