a
    
a                     @   sV   d dl mZmZmZmZ d dlZd dlZd dlZG dd dejej	Ze ej
e< dS )    )absolute_importdivisionprint_functionunicode_literalsNc                       s<   e Zd ZdZddlmZ dd Zdd Z fdd	Z  Z	S )
	Formattera  A custom string.Formatter with support for JSON pretty-printing.

    Adds {!j} format specification. When used, the corresponding value is converted
    to string using json_encoder.encode().

    Since string.Formatter in Python <3.4 does not support unnumbered placeholders,
    they must always be numbered explicitly - "{0} {1}" rather than "{} {}". Named
    placeholders are supported.
    r   )jsonc                 C   s.   dd l }|j| t | jtjt j d S )Nr   )types
ModuleType__init____name____dict__updatesysmodules)selfr    r   1lib/python3.9/site-packages/debugpy/common/fmt.pyr
   %   s    zFormatter.__init__c                 O   s   | j |g|R i |S )zSame as self.format().
        )format)r   format_stringargskwargsr   r   r   __call__-   s    zFormatter.__call__c                    s(   |dkr| j |S t| j| ||S )Nj)r   Z
JsonObjectsuperr   convert_field)r   value
conversion	__class__r   r   r   2   s    zFormatter.convert_field)
r   
__module____qualname____doc__Zdebugpy.commonr   r
   r   r   __classcell__r   r   r   r   r      s
   r   )Z
__future__r   r   r   r   stringr   r   r   r	   r   r   r   r   r   r   <module>   s
   $