�
Ϫ�f�{ � �& � d Z ddlZddlZddlmZ ddlmZmZmZ ddl m
Z
ddlmZm
Z
mZ ddlmZ d� Zd e_ dZ G d
� de� Z G d� d
e� Z G d� dej. � Z G d� dej. � Z G d� d� Z G d� dej. e� Z G d� de� Z G d� d� Z G d� dej. e� Z G d� de� Z G d� de� Z! G d � d!e� Z" G d"� d#� Z# e
e
jH � G d$� d%� � Z%y)&zN
Basic protocols, such as line-oriented, netstring, and int prefixed strings.
� N)�BytesIO)�calcsize�pack�unpack)�implementer)�defer�
interfaces�protocol)�logc �n � dj t t | � � j d� d| dg� S )N� �ascii� :� ,)�join�str�len�encode)�datas �9/usr/lib/python3/dist-packages/twisted/protocols/basic.py�_formatNetstringr s- � ��8�8�S��T��^�*�*�7�3�T�4��F�G�Gr
z_
Convert some C{bytes} into netstring format.
@param data: C{bytes} that will be reformatted.
c � � e Zd ZdZy)�NetstringParseErrorz=
The incoming data is not in valid Netstring format.
N��__name__�
__module__�__qualname__�__doc__� r
r r r ) � � �r
r c � � e Zd ZdZy)�IncompleteNetstringz2
Not enough data to complete a netstring.
Nr r r
r r" |