
    e                         d dl Z d dlZd dlZd Zd Zd Zd ZeZd Zd Z	 e
       j                  d ej                         z   e      Z e
       j                  d	 ej                         z   e	      Zy)
    Nc                  d    t         j                  j                  t         j                  d   d      S )NUSERPROFILEzLocal Settings)ospathjoinenviron     8/usr/lib/python3/dist-packages/keyring/util/platform_.py_settings_root_XPr      s!    77<<

=13CDDr
   c                  ~    t         j                  j                  dt         j                  j                  dd            S )NLOCALAPPDATAProgramData.)r   r   getr	   r
   r   _settings_root_Vistar   
   s&    ::>>."**..*LMMr
   c                      t        j                         \  } }}}| dk(  r
t               n	t               }t	        j
                  |d      S )NXPzPython Keyring)platform	win32_verr   r   pathlibPath)releaseversioncsdptyperoots        r   _data_root_Windowsr      s@    #+#5#5#7 GWc5")T/7K7MD<<.//r
   c                      t         j                  j                         dz  } t        j                  j                  dd      xs | }t        j                  |d      S )zW
    Use freedesktop.org Base Dir Specification to determine storage
    location.
    z.local/shareXDG_DATA_HOMENpython_keyring)r   r   homer   r   r   )fallbackr   s     r   _data_root_Linuxr$      sF    
 ||  "^3H::>>/40<HD<<.//r
   c                  f   d t               d<   t        j                  j                  t	               d      } t        j                  j                  t               d      }t        j                  j                  |      r4t        j                  j                  |       sd| d|  d}t        |      yy)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.
    c                       y )Nr	   r	   r
   r   <lambda>z(_check_old_config_root.<locals>.<lambda>*   s    r
   _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)globalsr   r   r   _config_root_Linuxr$   isfileRuntimeError)config_file_newconfig_file_oldmsgs      r   r(   r(   !   s     +7GI&'ggll#5#7IOggll#3#5GO	ww~~o&rww~~o/N=77H I44 	
 3 0O&r
   c                      t                t        j                  j                         dz  } d}t        j
                  j                  |d      xs | }t        j                  |d      S )zV
    Use freedesktop.org Base Dir Specification to determine config
    location.
    z.configXDG_CONFIG_HOMENr!   )r(   r   r   r"   r   r   r   )r#   keyr   s      r   r*   r*   6   sQ    
 ||  "Y.H
C::>>#t$0D<<.//r
   _data_root__config_root_)r   r   r   r   r   r   r$   _config_root_Windowsr(   r*   r)   r   system	data_rootconfig_rootr	   r
   r   <module>r9      sz    	  EN00 *  *	0 IMM-/(//*;;=MN	immOohoo.??ASTr
   