
    z
                     N    S 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	 r
g)
zUtilities for error reporting.    )absolute_import)division)unicode_literalsN)encodingzv(?P<stacktrace>Traceback \(most recent call last\):\n(?: {2}File ".*", line \d+, in .+\n {4}.+\n)+)(?P<exception>\S.+)z: {2}File "(?P<file>.*)google-cloud-sdk.*", line \d+, in .+c                 B   [         R                  " [        U 5      nU(       d  gU R                  5       n/ n[         R                  " [
        5      nSnU Hz  nUR                  U5      nU(       a4  UR                  UR                  UR                  S5      S5      5        SnMO  US-  nUS:  a  US==   U-  ss'   Mi  UR                  U5        M|     US   n[        R                  " U5      R                  SS5      S   nXsS'   S	R                  S
 U 5       5      S	-   nU$ )zGiven a stacktrace, only include Cloud SDK files in path.

Args:
  traceback: str, the original unformatted traceback

Returns:
  str, A new stacktrace with the private paths removed
  None, If traceback does not match traceback pattern
Nr   file       :
c              3   $   #    U  H  ov   M     g 7f)N ).0lines     6lib/googlecloudsdk/command_lib/error_reporting_util.py	<genexpr>8RemovePrivateInformationFromTraceback.<locals>.<genexpr>O   s      #42td2s   )researchPARTITION_TRACEBACK_PATTERN
splitlinescompileFILE_PATH_PATTERNmatchappendreplacegroupr   Decodesplitjoin)		tracebackr   stacktrace_listremove_path_stacktrace_listpattern_file_pathlines_since_matchr   exception_lineformatted_stacktraces	            r   %RemovePrivateInformationFromTracebackr*   %   s    ))/
;%	 ((*/ "jj!23d##D)E!((ekk&6I2)NO1	Q	#B'4/'#**40   /r2.??>288a@C.$2b! #42#4 46:;	    )__doc__
__future__r   r   r   r   googlecloudsdk.core.utilr   r   r   r*   r   r+   r   <module>r/      s3     % &  ' 	 -  B ,r+   