4Yѓn J d Z ddlmZ ddlZddlZddlmZmZ ddlm Z ej d Z ej d Z ej d Z ej d Z ej d Z ej d Z ej d Zd ZdZdZdZdZdZdZdZdZdZdZdZdZdZeez Z eez Z!eez Z" e#e Z$ e#e Z% e#e! Z& e#e" Z' e#e Z( e#e Z)dZ*dZ+dZ,dZ-dZ.d Z/ G d! d" Z0 G d# d$e Z1dS )%z NATS network protocol parser. )annotationsN)AnyDict) ProtocolErrors8 \AMSG\s+([^\s]+)\s+([^\s]+)\s+(([^\s]+)[^\S ]+)?(\d+) sC \AHMSG\s+([^\s]+)\s+([^\s]+)\s+(([^\s]+)[^\S ]+)?([\d]+)\s+(\d+) s \A\+OK\s* s \A-ERR\s+('.+')? s \APING\s* s \APONG\s* s \AINFO\s+([^ ]+) s INFOs CONNECTs PUBs MSGs HMSGs SUBs UNSUBs PINGs PONGs +OKs -ERR s i zstale connectionzauthorization violationzpermissions violationc 2 e Zd Zdd dZddZd dZdddZdS )ParserNreturnNonec <