HEX
Server: Apache/2.4.68 (Debian)
System: Linux as-cs-widget-demo-us-central1 6.1.0-44-cloud-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.164-1 (2026-03-09) x86_64
User: root (0)
PHP: 8.2.32
Disabled: NONE
Upload Files
File: //usr/lib/google-cloud-sdk/lib/surface/__pycache__/feedback.cpython-312.pyc
�

������dZddlmZddlmZddlmZddlZddlZddlmZddl	m
Z
ddl	mZdd	lm
Z
dd
lmZddlmZddlmZddlZdd
lmZdZdZdj3ee�Zdj3e
j6�Zd�Zd�Zej>ej@jB�Gd�dejD��Z#y)a�Command to assist user in submitting feedback about gcloud.

Does one of two things:

1. If invoked in the context of a recent gcloud crash (i.e. an exception that
was not caught anywhere in the Cloud SDK), will direct the user to the Cloud SDK
bug tracker, with a partly pre-filled form.

2. Otherwise, directs the user to either the Cloud SDK bug tracker,
StackOverflow, or the Cloud SDK groups page.
�)�absolute_import)�division)�unicode_literalsN)�base)�
feedback_util)�info_holder)�log)�
console_io)�files)�text)�mapz0http://stackoverflow.com/questions/tagged/gcloudzChttps://groups.google.com/forum/?fromgroups#!forum/google-cloud-deva
We appreciate your feedback.

If you have a question, post it on Stack Overflow using the "gcloud" tag at
[{0}].

For general feedback, use our groups page
[{1}],
send a mail to [google-cloud-dev@googlegroups.com] or visit the [#gcloud] IRC
channel on freenode.
zaWould you like to file a bug using our issue tracker site at [{0}] (will open a new browser tab)?c�6�|r:|js.tjdj|j��tjtjd�jtttj��tj�}tj|�|r+|jrtj|j�tj|j��tj|�y)z�Print message referring to various feedback resources for quiet execution.

  Args:
    info_str: str, the output of `gcloud info`
    log_data: info_holder.LogData, log data for the provided log file
  zHPlease consider including the log file [{0}] in any feedback you submit.a�
      If you have a question, post it on Stack Overflow using the "gcloud" tag
      at [{0}].

      For general feedback, use our groups page
      [{1}],
      send a mail to [google-cloud-dev@googlegroups.com], or visit the [#gcloud]
      IRC channel on freenode.

      If you have found a bug, file it using our issue tracker site at
      [{2}].

      Please include the following information when filing a bug report:      N)
�	tracebackr	�Print�format�filename�textwrap�dedent�STACKOVERFLOW_URL�GROUPS_PAGE_URLr�ISSUE_TRACKER_URL�
GetDivider�strip)�info_str�log_data�dividers   �lib/surface/feedback.py�_PrintQuietrHs�������	�i�i�(�)/���0A�0A�)B�D��)�)�H�O�O�
�
��6�#�_��1�1�3�4� 
�$�$�&�'��)�)�G��
�(�$�$��I�I�h� � �!��)�)�H�N�N����)�)�G��c���tj�j�}|rftjj	���fd�}tjtt||��dgzdd��}|t|�kr||Syy)Nc����|jrdnd}d}|jr%tj�|jz
�dz}dj	|j
||�S)Nz (crash detected)�zUnknown timez agoz
[{0}]{1}: {2})r�date�	text_util�PrettyTimeDeltar�command)�run�crash�time�nows   �r�_FormatLogDataz1_SuggestIncludeRecentLogs.<locals>._FormatLogDatapsS���%(�]�]�!��e�
�d�	����(�(��s�x�x��8�6�A��
�
#�
#�C�K�K���
=�=rz
None of theserzjWhich recent gcloud invocation would you like to provide feedback about? This will open a new browser tab.)�default�message)
r�LogsInfo�
GetRecentRuns�datetimer*r
�PromptChoice�listr
�len)�recent_runsr+�idxr*s   @r�_SuggestIncludeRecentLogsr6ls�����$�$�&�4�4�6�+��
�
�
�
�
�
!�C�>��
!�
!��S���
-�.�/�1B�B�A�E�G�C��S��
��
��
���rc�F�eZdZdZddiZejZed��Z	d�Z
y)�Feedbacka�Provide feedback to the Google Cloud CLI team.

  The Google Cloud CLI team offers support through a number of channels:

  * Google Cloud CLI Issue Tracker
  * Stack Overflow "#gcloud" tag
  * google-cloud-dev Google group

  This command lists the available channels and facilitates getting help through
  one of them by opening a web browser to the relevant page, possibly with
  information relevant to the current install and configuration pre-populated in
  form fields on that page.
  �EXAMPLESa
          To send feedback, including the log file for the most recent command,
          run:

            $ {command}

          To send feedback with a previously generated log file named
          'my-logfile', run:

            $ {command} --log-file=my-logfile
          c�*�|jdd��y)Nz
--log-filez-Path to the log file from a prior gcloud run.)�help)�add_argument)�parsers r�Argsz
Feedback.Args�s��
����
<��>rc�v�tjtj���}d}|jr*	tjj|j�}|jr ttj|�|�ytjj!t"�|s
t%�}|st'j(d��rt+j,||�yy#tj$r9}tjdj|j|��Yd}~��d}~wwxYw)N)�
anonymizerz,Error reading the specified file [{0}]: {1}
zXNo invocation selected. Would you still like to file a bug (will open a new browser tab))�
prompt_string)r�
InfoHolder�
Anonymizer�log_file�LogData�FromFiler�Errorr	�warningr�quietr�six�	text_type�statusr�FEEDBACK_MESSAGEr6r
�PromptContinuer�OpenNewIssueInBrowser)�self�args�infor�errs     r�RunzFeedback.Run�s����!�!�[�-C�-C�-E�F�D��H��}�}�8��&�&�/�/��
�
�>���z�z��#�-�-��%�x�0�	�j�j���'�(�
�,�.��	�Z�.�.�?�A�	�+�+�D�(�;�A���[�[�8�����"�F�4�=�=�#�6�	8�	8��8�s�)C,�,D8�?/D3�3D8N)�__name__�
__module__�__qualname__�__doc__�
detailed_helpr�SDK_TOOLS_CATEGORY�category�staticmethodr>rT�rrr8r8~s<����
��-��
$�
$�(��>��>�
<rr8)$rX�
__future__rrrr0r�googlecloudsdk.callioper�googlecloudsdk.command_librr�googlecloudsdk.corer	�googlecloudsdk.core.consoler
�googlecloudsdk.core.utilrrr$rJ�	six.movesr
rrrrMr�FEEDBACK_PROMPTrr6�
ReleaseTracks�ReleaseTrack�GA�Commandr8r]rr�<module>rjs��� 
�'��'���(�4�2�#�2�*�6�
��G��&����F��o�.����F�=�*�*�+��!�H�$����D�%�%�(�(�)�7<�t�|�|�7<�*�7<r