Next / Previous / Contents / Shipman's homepage

20. Sox._boolProcessor()

This function implements the interface described in Section 8.1, “content-processor for the bool type. We convert the value first to int because XML understands 0 and 1 but not strings like "True", then to Unicode.

sox.py
# - - -   S o x . _ b o o l P r o c e s s o r

    def _boolProcessor(self, item, contentList, attribs):
        '''content-processor for type bool

          [ type(item) is bool ->
              contentList  +:=  unicode(int(item)) ]
        '''
        contentList.append(unicode(int(item)))