o a@s|ddlZddlZddlZddZddZddZdd ZeZd d Zd d Z e de eZ e de e ZdS)NcCstjtjddS)N USERPROFILEzLocal Settings)ospathjoinenvironrr8/usr/lib/python3/dist-packages/keyring/util/platform_.py_settings_root_XPsr cCstjdtjddS)N LOCALAPPDATA ProgramData.)rrgetrrrr_settings_root_Vista srcCs2t\}}}}|dkrtnt}tj|dS)NXPzPython Keyring)platform win32_verr rrrr)releaseversioncsdptyperootrrr_data_root_WindowssrcCs.tjd}tjddp|}tj|dS)zW Use freedesktop.org Base Dir Specification to determine storage location. z .local/share XDG_DATA_HOMENpython_keyring)pathlibPathhomerrr rr)fallbackrrrr_data_root_LinuxsrcCshddtd<tjtd}tjtd}tj|r0tj|s2d|d|d}t|dSdS) a  Prior versions of keyring would search for the config in XDG_DATA_HOME, but should probably have been searching for config in XDG_CONFIG_HOME. If the config exists in the former but not in the latter, raise a RuntimeError to force the change. cSsdS)Nrrrrr*sz(_check_old_config_root.._check_old_config_rootz keyringrc.cfgz/Keyring config exists only in the old location z and should be moved to z& to work with this version of keyring.N)globalsrrr_config_root_Linuxrisfile RuntimeError)config_file_newconfig_file_oldmsgrrrr !s r cCs8ttjd}d}tj|dp|}tj|dS)zV Use freedesktop.org Base Dir Specification to determine config location. z.configXDG_CONFIG_HOMENr) r rrrrrr rr)rkeyrrrrr"6s r" _data_root_ _config_root)rrrr rrr_config_root_Windowsr r"r!r system data_root config_rootrrrrs