Format: application/x-python-code
⬇ Download File (4.6 KB)
   1  o
   2  
   3  ��h��@s�ddlZddlZddlZedfdd�ZGdd�de�ZGdd�de�Zdd
   4  d�Z	ddd
   5  �Z
   6  ddd�Zddd�Zddd�Z
   7  dd�Zdd�Zdd�ZdS)�N�evalcCst||d�}t|itj�S)Nr)�compiler�sys�modules)�code�path�mode�expr�r
   8  �Ic:\Users\shubh\Videos\agent\nova\Lib\site-packages\debugpy/common/util.py�evaluate
   9  srcs,eZdZdZdZdd�Z�fdd�Z�ZS)�
  10  Observablez$An object with change notifications.r
  11  cCs
  12  g|_dS�N)�	observers)�selfr
  13  r
  14  r�__init__s
  15  zObservable.__init__c
  16  s@zt��||�W|jD]}|||�qS|jD]}|||�qwr)�super�__setattr__r)r�name�value�ob��	__class__r
  17  rrs
  18  ��zObservable.__setattr__)�__name__�
  19  __module__�__qualname__�__doc__rrr�
  20  __classcell__r
  21  r
  22  rrr
  23  s
  24  r
  25  c@s.eZdZdZedd��Zd	dd�Zdd�ZdS)
  26  �Envz!A dict for environment variables.cCs
  27  ttj�S)z.Returns a snapshot of the current environment.)r�os�environr
  28  r
  29  r
  30  r�snapshot&s
  31  zEnv.snapshotNcCst|�}|dur
  32  |�|�|Sr)r�update)rZupdated_from�resultr
  33  r
  34  r�copy+s
  35  zEnv.copycCs<z
  36  tjj||}Wntyd}Ynw||||<dS)ztPrepends a new entry to a PATH-style environment variable, creating
  37          it if it doesn't exist already.
  38          �N)rr�pathsep�KeyError)r�key�entry�tailr
  39  r
  40  r�
  41  prepend_to1s�zEnv.prepend_tor)rrrr�staticmethodr!r$r+r
  42  r
  43  r
  44  rr#s
  45  
  46  r�strictcCst|t�r|�||�St|�S)zcConverts s to str, using the provided encoding. If s is already str,
  47      it is returned as is.
  48      )�
  49  isinstance�bytes�decode�str��s�encoding�errorsr
  50  r
  51  r�	force_str<sr6cCs6t|t�r|�||�St|�}|dkr|�||�|S)z�Converts s to bytes, using the provided encoding. If s is already bytes,
  52      it is returned as is.
  53  
  54      If errors="strict" and s is bytes, its encoding is verified by decoding it;
  55      UnicodeError is raised if it cannot be decoded.
  56      r-)r.r1�encoder/r0r2r
  57  r
  58  r�force_bytesCs
  59  r8cC�t|d|�S)z'Same as force_bytes(s, "ascii", errors)�ascii�r8�r3r5r
  60  r
  61  r�force_asciiT�r=cCr9)z&Same as force_bytes(s, "utf8", errors)�utf8r;r<r
  62  r
  63  r�
  64  force_utf8Yr>r@FcCs�z|j}Wn-ty2z|j}Wnty/zt|�}Wnty*YYYdSwd}YnwYnw|rEzt|�}Wn	tyDYnwt|dd�S)z�Returns the most descriptive name of a Python module, class, or function,
  65      as a Unicode string
  66  
  67      If quote=True, name is quoted with repr().
  68  
  69      Best-effort, but guaranteed to not fail - always returns something.
  70      z	<unknown>Fzutf-8�replace)r�	Exceptionr�reprr6)�obj�quoterr
  71  r
  72  r�nameof^s,	
  73  
  74  
  75  �����rFcCs~t|dd�}zt�|�}Wn
  76  tyY|Sw|d|��7}z	t�|�\}}Wn	ty1Ynw|d|��7}|d7}|S)z�Returns the most descriptive name of a Python module, class, or function,
  77      including source information (filename and linenumber), if available.
  78  
  79      Best-effort, but guaranteed to not fail - always returns something.
  80      T)rEz (file z, line �))rF�inspect�
  81  getsourcefilerB�getsourcelines)rDrZsrc_file�_Z
  82  src_linenor
  83  r
  84  r�	srcnameof~s ��rLcCs
  85  dtjvS)z>Returns True if the caller should hide something from debugpy.ZDEBUGPY_TRACE_DEBUGPY)rr r
  86  r
  87  r
  88  r�hide_debugpy_internals�s
  89  rMcCst�rd|_d|_dSdS)z�Disables tracing for the given thread if DEBUGPY_TRACE_DEBUGPY is not set.
  90      DEBUGPY_TRACE_DEBUGPY is used to debug debugpy with debugpy
  91      TN)rMZpydev_do_not_traceZis_pydev_daemon_thread)�threadr
  92  r
  93  r�hide_thread_from_debugger�s
  94  �rO)r-)F)rHrr�__file__r�objectr
  95  �dictrr6r8r=r@rFrLrMrOr
  96  r
  97  r
  98  r�<module>s	
  99  
 100  
 101  
 102  
 103