
    6
                     V    S r SSKrSSKrSSKrSSKrSSKJr  SSKJr  SSK	J
r
  SS jrg)z5Contains helper for appending user agent information.    N)system_util)StorageUrlFromString)InvalidUrlErrorc                    S[         R                  -  nUS[        R                  -  -  nUSU(       a  SOS-  -  nUS[        R
                  " 5       -  -  nUS[        R                  " 5       R                  -  -  n[        U 5      S:  a  US	U S   -  -  n[        U 5      S
:  a  U S   S;   a   [        [        R                  " U S   5      5      n[        [        R                  " U S   5      5      nUR                  5       (       a4  UR                  5       (       a  UR                  UR                  :w  a  US-  nOU S   S:X  a  SU ;   a  US-  nSU ;   a  US-  nSU ;   a  US-  n[        R                   " 5       (       a:  US-  n[        R"                  " 5       (       a  US[        R"                  " 5       -  -  nU$ ! [         a     Nmf = f)a  Using the command arguments return a suffix for the UserAgent string.

Args:
  args: str[], parsed set of arguments entered in the CLI.
  metrics_off: boolean, whether the MetricsCollector is disabled.

Returns:
  str, A string value that can be appended to an existing UserAgent.
z
 gsutil/%sz (%s)z analytics/%sdisabledenabledz interactive/%sz invocation-id/%sr   z command/%s   )cpmvrsyncz-DaisyChainrewritez-kz-sz-mz google-cloud-sdkz/%s)gslibVERSIONsysplatformr   IsRunningInteractivelyuuiduuid4hexlenr   sixensure_text
IsCloudUrlschemer   InvokedViaCloudSdkCloudSdkVersion)argsmetrics_off
user_agentsrcdsts        0platform/gsutil/gslib/utils/user_agent_helper.pyGetUserAgentr%      s    emm+*#,,&&*:)LL*!K$F$F$HHH*#djjl&6&666*Y]-$q'))J
4y1}	a)	)	$S__T"X%>?#$S__T"X%>?#^^#.."2"2szzSZZ7O-'J 7i4<

*4<

*t|Dj##%%%%J""$$EK77999j	'  	
	s   .BF< <
G	G	)T)__doc__r   r   r   r   gslib.utilsr   gslib.storage_urlr   gslib.exceptionr   r%        r$   <module>r,      s$    < 
 
   # 2 +0r+   