
                            S 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SK	J
r
  SSK	J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Jr  SrSrSR3                  \\5      rSR3                  \
R6                  5      rS rS r\R>                  " \R@                  RB                  5       " S S\RD                  5      5       r#g)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                 n   U(       a@  UR                   (       d/  [        R                  " SR                  UR                  5      5        [        R                  " [
        R                  " S5      R                  [        [        [        R                  5      5        [        R                  " 5       n[        R                  " U5        U(       a1  UR                   (       a   [        R                  " UR                   5        [        R                  " U R                  5       5        [        R                  " U5        g)zPrint 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_PrintQuietr   H   s     	ii ()/0A0A)BD ))HOO 
  6#_1134  $$&'))G($$IIh  !))HNN))G    c                  "  ^ [         R                  " 5       R                  5       n U (       ad  [        R                  R	                  5       mU4S jn[
        R                  " [        [        X5      5      S/-   SSS9nU[        U 5      :  a  X   $ g g )Nc                    > U R                   (       a  SOSnSnU R                  (       a&  [        R                  " TU R                  -
  5      S-   nSR	                  U R
                  X5      $ )Nz (crash detected) zUnknown timez agoz[{0}]{1}: {2})r   date	text_utilPrettyTimeDeltar   command)runcrashtimenows      r   _FormatLogData1_SuggestIncludeRecentLogs.<locals>._FormatLogDatap   sQ    %(]]!ed	((sxx86A##CKK==r   zNone of theser   zjWhich 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   _SuggestIncludeRecentLogsr7   l   s    $$&446+





!C> 
!
!S-./1BBAEGC S  r   c                   N    \ rS rSrSrSS0r\R                  r\	S 5       r
S rSrg)	Feedback~   a  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                 $    U R                  SSS9  g )Nz
--log-filez-Path to the log file from a prior gcloud run.)help)add_argument)parsers    r   ArgsFeedback.Args   s    
<  >r   c                    [         R                  " [         R                  " 5       S9nS nUR                  (       a*   [         R                  R                  UR                  5      nUR                  (       a!  [        [        R                  " U5      U5        g [        R                  R!                  ["        5        U(       d
  [%        5       nU(       d  [&        R(                  " SS9(       a  [*        R,                  " X#5        g g ! [        R                   a:  n[        R                  " SR                  UR                  U5      5         S nANS nAff = f)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_MESSAGEr7   r
   PromptContinuer   OpenNewIssueInBrowser)selfargsinfor   errs        r   RunFeedback.Run   s    !![-C-C-EFDH}}8&&//> zz#--%x0	jj'(,.	Z..?A 	++D;A [[ 8 "F4==#6	8 	88s   )D E0EE N)__name__
__module____qualname____firstlineno____doc__detailed_helpr   SDK_TOOLS_CATEGORYcategorystaticmethodr@   rW   __static_attributes__rY   r   r   r9   r9   ~   s<      
- $$(> >
<r   r9   )$r^   
__future__r   r   r   r1   r   googlecloudsdk.callioper   googlecloudsdk.command_libr   r   googlecloudsdk.corer	   googlecloudsdk.core.consoler
   googlecloudsdk.core.utilr   r   r$   rM   	six.movesr   r   r   r   rP   r   FEEDBACK_PROMPTr   r7   ReleaseTracksReleaseTrackGACommandr9   rY   r   r   <module>rp      s    
 '  '   ( 4 2 # 2 * 6 
  G & Fo.  F=**+ !H$ D%%(()7<t|| 7< *7<r   