Source code for pyfldigi.client.inputbuff
'''
'''
[docs]class Inputbuff(object):
'''
.. note:: An instance of this class automatically gets created under fldigi.Client() when it is constructed.
'''
def __init__(self, client):
'''
:param arg1: description
:param arg2: description
:type arg1: type description
:type arg1: type description
:return: return description
:rtype: the return type description
'''
self.client = client
self.buff = ''
def __str__(self):
'''
'''
self._get() # append any new data onto the buffer
return self.buff
def __len__(self):
self._get() # append any new data onto the buffer before returning length
return len(self.buff)
def _get(self):
'''Returns all RX data received since last query.
'''
resp = self.client.rx.get_data()
if isinstance(resp, str):
self.buff += resp