Next / Previous / Contents / Shipman's homepage

42. class BroodField: Brood patch

Brood patch code; derived from Section 27, “class SingleField: Generic single-character field”. This field may be blank, so a space character is included in the VALID_CODES string. For valid codes, see the specification.

baseclasses.py
# - - - - -   c l a s s   B r o o d F i e l d   - - - - -

class BroodField(SingleField):
    '''Represents a brood patch code.
    '''

    VALID_CODES = "012345 "

    @staticmethod
    def scanField(encounter, scan, fieldName):
        '''Scan a brood patch code.
        '''
        SingleField.scanField(encounter, scan, fieldName,
                                BroodField, "brood patch")