'Message' did not really need capitalizing within its own docstrings
This commit is contained in:
parent
b8fbbb3d32
commit
e293dff653
|
@ -28,7 +28,7 @@ from paramiko import util
|
||||||
|
|
||||||
class Message (object):
|
class Message (object):
|
||||||
"""
|
"""
|
||||||
An SSH2 Message is a stream of bytes that encodes some combination of
|
An SSH2 message is a stream of bytes that encodes some combination of
|
||||||
strings, integers, bools, and infinite-precision integers (known in Python
|
strings, integers, bools, and infinite-precision integers (known in Python
|
||||||
as longs). This class builds or breaks down such a byte stream.
|
as longs). This class builds or breaks down such a byte stream.
|
||||||
|
|
||||||
|
@ -39,10 +39,10 @@ class Message (object):
|
||||||
|
|
||||||
def __init__(self, content=None):
|
def __init__(self, content=None):
|
||||||
"""
|
"""
|
||||||
Create a new SSH2 Message.
|
Create a new SSH2 message.
|
||||||
|
|
||||||
:param content: the byte stream to use as the Message content (passed
|
:param content: the byte stream to use as the message content (passed
|
||||||
in only when decomposing a Message).
|
in only when decomposing a message).
|
||||||
:type content: string
|
:type content: string
|
||||||
"""
|
"""
|
||||||
if content != None:
|
if content != None:
|
||||||
|
@ -52,9 +52,9 @@ class Message (object):
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
"""
|
"""
|
||||||
Return the byte stream content of this Message, as a string.
|
Return the byte stream content of this message, as a string.
|
||||||
|
|
||||||
:return: the contents of this Message.
|
:return: the contents of this message.
|
||||||
:rtype: string
|
:rtype: string
|
||||||
"""
|
"""
|
||||||
return self.packet.getvalue()
|
return self.packet.getvalue()
|
||||||
|
@ -76,7 +76,7 @@ class Message (object):
|
||||||
|
|
||||||
def get_remainder(self):
|
def get_remainder(self):
|
||||||
"""
|
"""
|
||||||
Return the bytes of this Message that haven't already been parsed and
|
Return the bytes of this message that haven't already been parsed and
|
||||||
returned.
|
returned.
|
||||||
|
|
||||||
:return: a string of the bytes not parsed yet.
|
:return: a string of the bytes not parsed yet.
|
||||||
|
@ -89,8 +89,8 @@ class Message (object):
|
||||||
|
|
||||||
def get_so_far(self):
|
def get_so_far(self):
|
||||||
"""
|
"""
|
||||||
Returns the bytes of this Message that have been parsed and returned.
|
Returns the bytes of this message that have been parsed and returned.
|
||||||
The string passed into a Message's constructor can be regenerated by
|
The string passed into a message's constructor can be regenerated by
|
||||||
concatenating ``get_so_far`` and `get_remainder`.
|
concatenating ``get_so_far`` and `get_remainder`.
|
||||||
|
|
||||||
:return: a string of the bytes parsed so far.
|
:return: a string of the bytes parsed so far.
|
||||||
|
@ -102,10 +102,10 @@ class Message (object):
|
||||||
|
|
||||||
def get_bytes(self, n):
|
def get_bytes(self, n):
|
||||||
"""
|
"""
|
||||||
Return the next ``n`` bytes of the Message, without decomposing into
|
Return the next ``n`` bytes of the message, without decomposing into
|
||||||
an int, string, etc. Just the raw bytes are returned.
|
an int, string, etc. Just the raw bytes are returned.
|
||||||
|
|
||||||
:return: a string of the next ``n`` bytes of the Message, or a string
|
:return: a string of the next ``n`` bytes of the message, or a string
|
||||||
of ``n`` zero bytes, if there aren't ``n`` bytes remaining.
|
of ``n`` zero bytes, if there aren't ``n`` bytes remaining.
|
||||||
:rtype: string
|
:rtype: string
|
||||||
"""
|
"""
|
||||||
|
@ -117,10 +117,10 @@ class Message (object):
|
||||||
|
|
||||||
def get_byte(self):
|
def get_byte(self):
|
||||||
"""
|
"""
|
||||||
Return the next byte of the Message, without decomposing it. This
|
Return the next byte of the message, without decomposing it. This
|
||||||
is equivalent to `get_bytes(1) <get_bytes>`.
|
is equivalent to `get_bytes(1) <get_bytes>`.
|
||||||
|
|
||||||
:return: the next byte of the Message, or ``'\000'`` if there aren't
|
:return: the next byte of the message, or ``'\000'`` if there aren't
|
||||||
any bytes remaining.
|
any bytes remaining.
|
||||||
:rtype: string
|
:rtype: string
|
||||||
"""
|
"""
|
||||||
|
@ -130,7 +130,7 @@ class Message (object):
|
||||||
"""
|
"""
|
||||||
Fetch a boolean from the stream.
|
Fetch a boolean from the stream.
|
||||||
|
|
||||||
:return: ``True`` or ``False`` (from the Message).
|
:return: ``True`` or ``False`` (from the message).
|
||||||
:rtype: bool
|
:rtype: bool
|
||||||
"""
|
"""
|
||||||
b = self.get_bytes(1)
|
b = self.get_bytes(1)
|
||||||
|
@ -167,7 +167,7 @@ class Message (object):
|
||||||
"""
|
"""
|
||||||
Fetch a string from the stream. This could be a byte string and may
|
Fetch a string from the stream. This could be a byte string and may
|
||||||
contain unprintable characters. (It's not unheard of for a string to
|
contain unprintable characters. (It's not unheard of for a string to
|
||||||
contain another byte-stream Message.)
|
contain another byte-stream message.)
|
||||||
|
|
||||||
:return: a string.
|
:return: a string.
|
||||||
:rtype: string
|
:rtype: string
|
||||||
|
|
Loading…
Reference in New Issue