
    ~                     Z    S r SSKJr  SSKJr  SSKJr  SSKJr  SSKrSSKrSSKJ	r	  S r
g)	zBUtilities shared between local and cloud code dev implementations.    )absolute_import)division)print_function)unicode_literalsN)
exceptionsc                    Ub  [         R                  R                  [         R                  R                  X5      5      n[         R                  R	                  U5      (       a  U$ [
        R                  " SR                  U5      5      eS HM  n[        R                  " [         R                  R                  X5      5      nU(       d  M?  [        U5      S   s  $    g)a  Rules for choosing a service.yaml or app.yaml file.

The rules are meant to discover common filename variants like
'service.dev.yml' or 'staging-service.yaml'.

Args:
  context: Build context dir. Could be '.'.
  arg: User's path (relative to context or absolute) to a yaml file with
    service config, or None. The service config could be a knative Service
    description or an appengine app.yaml.

Returns:
  Absolute path to a yaml file, or None.
NzFile '{}' not found.)z*service.dev.yamlz*service.dev.ymlz*service.yamlz*service.ymlr   )
ospathabspathjoinexistsr   Errorformatglobsorted)contextargcomplete_abs_pathpatternmatchess        -lib/googlecloudsdk/command_lib/code/common.pyChooseExistingServiceYamlr      s     	_W(BC	ww~~'((


1889JK
LLg iiW67GwG_Q 
    )__doc__
__future__r   r   r   r   r   r	   googlecloudsdk.corer   r    r   r   <module>r      s%    I &  % '  	 *r   