
    u
                        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dlm	Z	 ddl
mZ dd	l
mZ  ej                  ej                  j                  ej                  j                          G d
 dej"                               Zy)zThe Browse command.    )absolute_import)division)unicode_literals)base)browser_dispatcher)flags)log)
propertiesc                   0    e Zd ZdZdddZed        Zd Zy)Browsez*Open the current app in a web browser.

  z"          {description}
          a            To open the default service, run:

              $ {command}

          To open a specific service, run:

              $ {command} --service="myService"

          To open a specific version, run:

              $ {command} --service="myService" --version="v1"
          )DESCRIPTIONEXAMPLESc                     | j                   j                  d       t        j                  j	                  |        | j                  ddd       | j                  ddd       y )	Nz
value(url)z	--versionz-vzvThe version of the app that should be opened. If not specified, choose a version based on the service's traffic split.)helpz	--servicez-szzThe service that should be opened. If not specified, use the default service. May be used in conjunction with `--version`.)display_info	AddFormatr   LAUNCH_BROWSERAddToParseradd_argument)parsers    lib/surface/app/browse.pyArgszBrowse.Args5   sl    
!!,/	$$V,
G  I
 N  P    c                 6   t         j                  j                  j                  j	                  d      }t        j                  ||j                  |j                  |j                        }|r-|j                  rt        j                  j                  d       |S y)z+Launch a browser, or return a URL to print.T)requiredz>Did not detect your browser. Go to this link to view your app:N)r
   VALUEScoreprojectGetr   	BrowseAppserviceversionlaunch_browserr	   statusPrint)selfargsr   
url_formats       r   Runz
Browse.RunD   s~    $$,,00$0?G#--g.2ll.2ll.2.A.ACJ 			

L	Nr   N)__name__
__module____qualname____doc__detailed_helpstaticmethodr   r)    r   r   r   r      s3    
	-& P Pr   r   N)r-   
__future__r   r   r   googlecloudsdk.callioper   googlecloudsdk.command_lib.appr   r   googlecloudsdk.corer	   r
   ReleaseTracksReleaseTrackGABETACommandr   r0   r   r   <module>r:      si     &  ' ( = 0 # * D%%(($*;*;*@*@A3T\\ 3 B3r   