Known subclasses: dulwich.protocol.ReceivableProtocol

Class for interacting with a remote git process over the wire.

Parts of the git wire protocol use 'pkt-lines' to communicate. A pkt-line consists of the length of the line as a 4-byte hex string, followed by the payload data. The length includes the 4-byte header. The special line '0000' indicates the end of a section of input and is called a 'flush-pkt'.

For details on the pkt-line format, see the cgit distribution:
Documentation/technical/protocol-common.txt
Method __init__ Undocumented
Method close Undocumented
Method __enter__ Undocumented
Method __exit__ Undocumented
Method read_pkt_line Reads a pkt-line from the remote git process.
Method eof Test whether the protocol stream has reached EOF.
Method unread_pkt_line Unread a single line of data into the readahead buffer.
Method read_pkt_seq Read a sequence of pkt-lines from the remote git process.
Method write_pkt_line Sends a pkt-line to the remote git process.
Method write_file Return a writable file-like object for this protocol.
Method write_sideband Write multiplexed data to the sideband.
Method send_cmd Send a command and some arguments to a git server.
Method read_cmd Read a command and some arguments from the git client
def __init__(self, read, write, close=None, report_activity=None):
Undocumented
def close(self):
Undocumented
def __enter__(self):
Undocumented
def __exit__(self, exc_type, exc_val, exc_tb):
Undocumented
def read_pkt_line(self):

Reads a pkt-line from the remote git process.

This method may read from the readahead buffer; see unread_pkt_line.

ReturnsThe next string from the stream, without the length prefix, or None for a flush-pkt ('0000').
def eof(self):

Test whether the protocol stream has reached EOF.

Note that this refers to the actual stream EOF and not just a flush-pkt.

ReturnsTrue if the stream is at EOF, False otherwise.
def unread_pkt_line(self, data):

Unread a single line of data into the readahead buffer.

This method can be used to unread a single pkt-line into a fixed readahead buffer.

ParametersdataThe data to unread, without the length prefix.
RaisesValueErrorIf more than one pkt-line is unread.
def read_pkt_seq(self):
Read a sequence of pkt-lines from the remote git process.
ReturnsYields each line of data up to but not including the next flush-pkt.
def write_pkt_line(self, line):
Sends a pkt-line to the remote git process.
ParameterslineA string containing the data to send, without the length prefix.
def write_file(self):
Return a writable file-like object for this protocol.
def write_sideband(self, channel, blob):
Write multiplexed data to the sideband.
ParameterschannelAn int specifying the channel to write to.
blobA blob of data (as a string) to send on this channel.
def send_cmd(self, cmd, *args):

Send a command and some arguments to a git server.

Only used for the TCP git protocol (git://).

ParameterscmdThe remote service to access.
argsList of arguments to send to remove service.
def read_cmd(self):

Read a command and some arguments from the git client

Only used for the TCP git protocol (git://).

ReturnsA tuple of (command, [list of arguments]).
API Documentation for Dulwich, generated by pydoctor at 2018-11-17 19:05:54.