
    Idj                     f    d dl Z d dlmZ d dlmZ d dlmZ d dlmZ  G d de j                        Zy)    N)datetime)Decimal)Enum)Dnc                       e Zd ZdZd Zy)JSONEncodera  Custom JSON encoder class to help out with some data types.

    For example, the json module has no idea how to encode a Dn object to str.
    Another common object that is handled is Decimal types.

    In addition, any objects that have a __json__ method will get called.
    c                 6   t        |t        t        f      rt        |      S t        |t              rt        |j
                        S t        |t              r|j                         S t        |dd       r%t        |j                        r|j                         S |S )N__json__)
isinstancer   r   strr   valuer   	isoformatgetattrcallabler
   )selfobjs     7/usr/lib/python3/dist-packages/samba/netcmd/encoders.pydefaultzJSONEncoder.default(   so    cGR=)s8OT"syy>!X&==?"S*d+0F<<>!
    N)__name__
__module____qualname____doc__r    r   r   r   r      s    	r   r   )	jsonr   decimalr   enumr   ldbr   r   r   r   r   <module>r      s(   .     $"" r   