Known subclasses: twisted.positioning.nmea.NMEASentence, twisted.positioning.test.test_sentence.DummySentence, twisted.positioning.test.test_sentence.MixinSentence

A base sentence class for a particular protocol.

Using this base class, specific sentence classes can almost automatically be created for a particular protocol. To do this, fill the ALLOWED_ATTRIBUTES class attribute using the getSentenceAttributes class method of the producer:

   class FooSentence(BaseSentence):
       """
       A sentence for integalactic transmodulator sentences.

       @ivar transmogrificationConstant: The value used in the
           transmogrifier while producing this sentence, corrected for
           gravitational fields.
       @type transmogrificationConstant: C{Tummy}
       """
       ALLOWED_ATTRIBUTES = FooProtocol.getSentenceAttributes()
Instance Variable presentAttributes 0 An iterable containing the names of the attributes that are present in this sentence. (type: iterable of str)
Class Variable ALLOWED_ATTRIBUTES A set of attributes that are allowed in this sentence. (type: set of str)
Method __init__ Initializes a sentence with parsed sentence data.
Method presentAttributes An iterable containing the names of the attributes that are present in this sentence.
Method __getattr__ Gets an attribute of this sentence.
Method __repr__ Returns a textual representation of this sentence.
presentAttributes 0 =
An iterable containing the names of the attributes that are present in this sentence. (type: iterable of str)
ALLOWED_ATTRIBUTES =
A set of attributes that are allowed in this sentence. (type: set of str)
def __init__(self, sentenceData):

Initializes a sentence with parsed sentence data.

ParameterssentenceDataThe parsed sentence data. (type: dict (str -> str or None))
@property
def presentAttributes(self):

An iterable containing the names of the attributes that are present in this sentence.

ReturnsThe iterable of names of present attributes. (type: iterable of str)
def __getattr__(self, name):

Gets an attribute of this sentence.

def __repr__(self):

Returns a textual representation of this sentence.

ReturnsA textual representation of this sentence. (type: str)
API Documentation for twisted, generated by pydoctor at 2020-03-25 17:34:30.