
                         ~    d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ dZ	 G d d	ej                        Zd
 Zd Zy)z5Convenience functions for dealing with gaia accounts.    )absolute_import)division)unicode_literals)
exceptions)
properties    c                       e Zd ZdZy)GaiaExceptionz1GaiaException is for non-code-bug errors in gaia.N)__name__
__module____qualname____doc__     +lib/googlecloudsdk/command_lib/util/gaia.pyr
   r
      s    9r   r
   c                 .   | j                  d      d   j                         }|st        dj                  |             dj	                  |D cg c]  }|j                         r|nd c}      }|d   j                         sd|z   }|dt         S c c}w )	z4Returns the default account name given a GAIA email.@r   z Invalid email address [{email}].)email _gN)	partitionlowerr
   formatjoinisalnumisalpha_MAX_ACCOUNT_NAME_LENGTH)r   account_namechars      r    MapGaiaEmailToDefaultAccountNamer!   !   s     %a(..0,	
:e,. .3?@<4t||~t3&<@B,	a	 	 	"%L	//	00 As   Bc                  x    t        t        j                  j                  j                  j                               S )N)r!   r   VALUEScoreaccountGetr   r   r   GetDefaultAccountNamer'   4   s(    	)**;*;*@*@*H*H*L*L*N	OOr   N)r   
__future__r   r   r   googlecloudsdk.corer   core_exceptionsr   r   Errorr
   r!   r'   r   r   r   <module>r,      s>     < &  ' = *  :O)) :1&Pr   