Ë
    €Ï  ã                   óÔ   — d Z ddlmZ ddlmZ ddlmZ ddlZddlZddlmZ ddlm	Z	 ddl
mZ d	Zd
„ Zd„ Zd„ Zd„ ZeeeedœZddlmZ ddlmZ ddlmZ ddlmZ d„ Zd„ Z e«        y)zÖUtilities for the interactive gcloud debugger.

Contains things like:
  - Common imports pre-imported
  - Easy utility wrappers
  - Pre-initialized API clients

That make interactive debugging with gcloud a dream.
é    )Úabsolute_import)Údivision)Úunicode_literalsN)Úapis)Úapis_internal)Úapis_mapa+  
                   _     _     _     _     _     _     _
                  / \   / \   / \   / \   / \   / \   / \
                 ( W ) ( E ) ( L ) ( C ) ( O ) ( M ) ( E )
                  \_/   \_/   \_/   \_/   \_/   \_/   \_/

                _____               ________)
               |_   _|___          (, /         /)      /)
                 | | | . |           /___, _   (/_     // ___    _
                 |_| |___|          /     (_(_/_) (_(_(/_(_)(_(_/_)_
                                 (_/
             _                 _       _      _
            | |               | |     | |    | |
   __ _  ___| | ___  _   _  __| |   __| | ___| |__  _   _  __ _  __ _  ___ _ __
  / _` |/ __| |/ _ \| | | |/ _` |  / _` |/ _ \ '_ \| | | |/ _` |/ _` |/ _ \ '__|
 | (_| | (__| | (_) | |_| | (_| | | (_| |  __/ |_) | |_| | (_| | (_| |  __/ |
  \__, |\___|_|\___/ \__,_|\__,_|  \__,_|\___|_.__/ \__,_|\__, |\__, |\___|_|
   __/ |                                                   __/ | __/ |
  |___/                                                   |___/ |___/
c                  ó  — 	 ddl } ddl}| j                  |j                  t	        «       «      j
                  «       | j                  d«       t        j                  t	        «       «      }|j                  t        «       y# t        $ r Y Œ>w xY w)z<Run a console based on the built-in code.InteractiveConsole.r   Nztab: complete)ÚreadlineÚrlcompleterÚset_completerÚ	CompleterÚglobalsÚcompleteÚparse_and_bindÚImportErrorÚcodeÚInteractiveConsoleÚinteractÚ_BANNER)r
   r   Úconsoles      ú,lib/googlecloudsdk/command_lib/meta/debug.pyÚ_PythonConsoler   @   sr   € ð	-ãÛð
 ×Ñ˜;×0Ñ0´³Ó;×DÑDÔEØ×Ñ˜OÔ,Ü×#Ñ#¤G£IÓ.€'Ø	×Ñ”7Õøô 
ò 	Ùð	ús   ‚B  Â 	BÂBc                  ó,   — ddl } | j                  «        y)z(Run a console based on the built-in pdb.r   N)ÚpdbÚ	set_trace)r   s    r   Ú_PdbConsoler   P   s   € ãØ‡--…/ó    c                  óv   — 	 ddl } | j                  «        y# t        $ r t        j                  d«       Y yw xY w)z&Run a console based on IPython's ipdb.r   NzxCould not start the ipdb debugger. Please ensure that it is installed, or try the default debugger with `--mode=python`.)Úipdbr   r   ÚlogÚerror)r   s    r   Ú_IpdbConsoler"   V   ó9   € ðNÛØ‡NNÕøÜ	ò NÜ‡IIð Mö NðNúó   ‚ —8·8c                  óv   — 	 ddl } | j                  «        y# t        $ r t        j                  d«       Y yw xY w)zRun a console based on PuDB.r   NzxCould not start the PuDB debugger. Please ensure that it is installed, or try the default debugger with `--mode=python`.)Úpudbr   r   r    r!   )r&   s    r   Ú_PudbConsoler'   `   r#   r$   )Úpythonr   r   r&   )r    )Ú
properties)Ú
console_io)Úfilesc                  ó–   — t         j                  D ]6  } t        j                  | t	        j
                  | «      «      t        «       | <   Œ8 y)z6Populate the global module namespace with API clients.N)r   ÚMAPr   ÚGetClientInstancer   Ú_GetDefaultVersionr   )Úapi_names    r   ÚLoadApisr1   ‚   s7   € ä—,”,€hä×0Ñ0Ø”-×2Ñ2°8Ó<ó>„GƒIˆhÒñ r   c                  ó´   ‡— dj                  t        j                  «      Š G ˆfd„dt        «      } t        j
                  D ]  } | «       t        «       |<   Œ y)zîMake API names print instructions for loading the APIs when __repr__'ed.

  For example:

  >>> appengine
  Run `LoadApis()` to load all APIs, including this one.

  Load APIs it lazily because it takes about a second to load all APIs.
  z1Run `{0}()` to load all APIs, including this one.c                   ó   •— e Zd Zˆ fd„Zy)ú:_PopulateApiNamesWithLoadMessage.<locals>._LoadApisMessagec                 ó   •— ‰S )N© )ÚselfÚload_apis_messages    €r   Ú__repr__zC_PopulateApiNamesWithLoadMessage.<locals>._LoadApisMessage.__repr__š   s	   ø€ ØÐr   N)Ú__name__Ú
__module__Ú__qualname__r9   )r8   s   €r   Ú_LoadApisMessager4   ˜   s   ø„ õr   r=   N)Úformatr1   r:   Úobjectr   r-   r   )r=   r0   r8   s     @r   Ú _PopulateApiNamesWithLoadMessager@   Š   sJ   ø€ ð :¿6¹6Ü
×
Ñ
ó<ð öœô ô
 —,”,€hÙ*Ó,„GƒIˆhÒñ r   )Ú__doc__Ú
__future__r   r   r   r   ÚsiteÚgooglecloudsdk.api_lib.utilr   r   Ú%googlecloudsdk.generated_clients.apisr   r   r   r   r"   r'   ÚCONSOLESÚgooglecloudsdk.corer    r)   Úgooglecloudsdk.core.consoler*   Úgooglecloudsdk.core.utilr+   r1   r@   r6   r   r   Ú<module>rJ      sx   ðñõ 'Ý Ý 'ã ó å ,Ý 5Ý :ð€ò,ò òNòNð ØØØñ	€õ $Ý *Ý 2Ý *ò>ò-ñ. !Õ "r   