Your IP : 172.28.240.42


Current Path : /usr/lib/python2.7/dist-packages/keyring/
Upload File :
Current File : //usr/lib/python2.7/dist-packages/keyring/core.pyc


F+Oc@sdZddlZyddlZWnek
rAddlZnXddlZddlZddlm	Z	ddlm
Z
ddlmZddlm
Z
dZdZd	Zd
ZdZdZd
ZedS(s.
core.py

Created by Kang Zhang on 2009-07-09
iN(tlogger(tbackend(tplatform(t
loc_compatcCs+t|tjr|antddS(s!Set current keyring backend.
    s0The keyring must be a subclass of KeyringBackendN(t
isinstanceRtKeyringBackendt_keyring_backendt	TypeError(tkeyring((s0/usr/lib/python2.7/dist-packages/keyring/core.pytset_keyrings	cCstS(s!Get current keyring backend.
    (R(((s0/usr/lib/python2.7/dist-packages/keyring/core.pytget_keyringscCstj||S(s,Get password from the specified service
    (Rtget_password(tservice_nametusername((s0/usr/lib/python2.7/dist-packages/keyring/core.pyR"scCstj|||dS(s7Set password for the user in the specified service
    N(Rtset_password(RR
tpassword((s0/usr/lib/python2.7/dist-packages/keyring/core.pyR'scCsOt}|dkrAtj}|jdd|d}nt|dS(sLoad a keyring from a config file or for the default platform.

    First try to load the keyring in the config file, if it has not
    been declared, assign a default keyring according to the platform.
    tkeycSs|jS(N(t	supported(tx((s0/usr/lib/python2.7/dist-packages/keyring/core.pyt<lambda>:siN(tload_configtNoneRtget_all_keyringtsortR	(Rtkeyrings((s0/usr/lib/python2.7/dist-packages/keyring/core.pytinit_backend,s	
csfdytj||jd }Wn*tk
rY|tj|g}nX|jddj}t||}|S(sLoad the specified keyring name from the specified path

    `keyring_path` can be None and it will not interfere with the loading
    process.
    c
s|jd}tj|d|}|\}}}tj|d|||}|rc|jnt|dkrdj|d}|}	y||j}	Wntk
r|SX||	S|S(s1Load the specified module from the disk.
        t.ii(	tsplittimptfind_moduletload_moduletclosetlentjoint__path__tAttributeError(
tnametpatht	path_listtmodule_infotmodule_filetpathnametdescriptiontmoduletsub_nametsub_path(R(s0/usr/lib/python2.7/dist-packages/keyring/core.pyRHs 


Ri(tsystmodulestrfindtKeyErrorR%Rtstriptgetattr(tkeyring_pathtkeyring_nameR+t
keyring_classtkeyring_temp((Rs0/usr/lib/python2.7/dist-packages/keyring/core.pytload_keyringAs
cCsd}d}tjjtj|}tjjtjjd|}tjjtj|}tj	||||g}d}x*|D]"}|}tjj
|rPqqWtjj
|rtj}|j
|y4|jdr
|jddj}	nd}	Wntjk
r-d}	nXyO|jdr[|jddj}
ntjddt|	|
}Wqtjtfk
rtjdd|qXn|S(	sLoad a keyring using the config file.

    The config file can be in the current working directory, or in the user's
    home directory.
    s
keyringrc.cfgt~Rskeyring-pathsdefault-keyrings/Keyring config file contains incorrect values.
sConfig file: %sN(RtosR%R!tgetcwdt
expanduserRt	data_rootRt
relocate_filetexistst
config_parsertRawConfigParsertreadthas_sectiontgetR2t
NoOptionErrorR8tImportErrorRtwarning(Rtfilenamet
local_pathtlegacy_pathtconfig_pathtkeyring_cfg_candidatestkeyring_cfgR%tconfigR4R5((s0/usr/lib/python2.7/dist-packages/keyring/core.pyRms<!



	(t__doc__R:tconfigparserR@RFtConfigParserRR.RRRtkeyring.utilRRR	R
RRRR8R(((s0/usr/lib/python2.7/dist-packages/keyring/core.pyt<module>s&
							,	4