관리-도구
편집 파일: _ipaddress.cpython-311.pyc
� �܋fj � �R � d Z ddlmZmZmZmZmZ dadad d�Z d� Z d d�Zd d�Zd� Z dS ) z>Implementation of the ipaddres-based network types adaptation � )�new_type�new_array_type� register_type�register_adapter�QuotedStringNc � � ddl a t �t � � at D ]}t || � � �t j t j t j t j fD ]}t |t � � �dS )a Register conversion support between `ipaddress` objects and `network types`__. :param conn_or_curs: the scope where to register the type casters. If `!None` register them globally. After the function is called, PostgreSQL :sql:`inet` values will be converted into `~ipaddress.IPv4Interface` or `~ipaddress.IPv6Interface` objects, :sql:`cidr` values into into `~ipaddress.IPv4Network` or `~ipaddress.IPv6Network`. .. __: https://www.postgresql.org/docs/current/static/datatype-net-types.html r N) � ipaddress�_casters� _make_castersr � IPv4Interface� IPv6Interface�IPv4Network�IPv6Networkr �adapt_ipaddress)�conn_or_curs�c�ts �f/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib64/python3.11/site-packages/psycopg2/_ipaddress.py�register_ipaddressr % s� � � ���� �� �?�?�� � '� '���a��&�&�&�&��%�y�'>��#�Y�%:�<� -� -����O�,�,�,�,�-� -� c � � t ddt � � } t dd| � � }t ddt � � }t dd|� � }| |||gS ) N)ie �INET)i zINET[])i� �CIDR)i� zCIDR[])r �cast_interfacer �cast_network)�inet�ainet�cidr�acidrs r r r B sU � ��F�F�N�3�3�D��7�H�d�3�3�E��F�F�L�1�1�D��6�8�T�2�2�E��%��u�%�%r c �X � | �d S t � t | � � � � S �N)r �ip_interface�str��s�curs r r r L s&