Next / Previous / Contents / Shipman's homepage

14.2. AgeSexGroup.readNode() (static method)

This method looks to see if the given node has any age-sex-group content and, if so, makes it into an AgeSexGroup instance and returns that. If there is no such content, it returns None. For the constructor, see Section 14.1, “AgeSexGroup.__init__().

birdnotes.py
# - - -   A g e S e x G r o u p . r e a d N o d e

#   @staticmethod
    def readNode ( node ):
        """Check for age-sex-group content.
        """
        age  =  node.attrib.get ( rnc.AGE_A, None )
        sex  =  node.attrib.get ( rnc.SEX_A, None )
        q  =  node.attrib.get ( rnc.Q_A, None )
        count  =  node.attrib.get ( rnc.COUNT_A, None )
        fide  =  node.attrib.get ( rnc.FIDE_A, None )
        if  sex or age or q or count or fide:
            return AgeSexGroup ( age, sex, q, count, fide )
        else:
            return None

    readNode  =  staticmethod ( readNode )