class documentation
class _BaseSentence: (source)
Known subclasses: twisted.positioning.nmea.NMEASentence
Constructor: _BaseSentence(sentenceData)
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()
| Method | __getattr__ |
Gets an attribute of this sentence. |
| Method | __init__ |
Initializes a sentence with parsed sentence data. |
| Method | __repr__ |
Returns a textual representation of this sentence. |
| Constant | ALLOWED |
A set of attributes that are allowed in this sentence. |
| Property | present |
An iterable containing the names of the attributes that are present in this sentence. |
| Instance Variable | _sentence |
Undocumented |
Initializes a sentence with parsed sentence data.
| Parameters | |
sentenceNone) | The parsed sentence data. |
Returns a textual representation of this sentence.
| Returns | |
| str | A textual representation of this sentence. |
overridden in
twisted.positioning.nmea.NMEASentenceA set of attributes that are allowed in this sentence.
| Value |
|