%PDF- %PDF-
| Direktori : /usr/lib/python3/dist-packages/samba/netcmd/__pycache__/ |
| Current File : //usr/lib/python3/dist-packages/samba/netcmd/__pycache__/encoders.cpython-312.pyc |
�
�I�dj � �f � d dl Z d dlmZ d dlmZ d dlmZ d dlmZ G d� de j � Zy)� N)�datetime)�Decimal)�Enum)�Dnc � � e Zd ZdZd� Zy)�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� rt |� S t |t � rt |j
� S t |t � r|j � S t |dd � 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�defaultzJSONEncoder.default( so � ��c�G�R�=�)��s�8�O�
��T�
"��s�y�y�>�!�
��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