def state_fetch_att(self, s):
        # Allowed fetch_att tokens are "ENVELOPE", "FLAGS", "INTERNALDATE",
        # "RFC822", "RFC822.HEADER", "RFC822.SIZE", "RFC822.TEXT", "BODY",
        # "BODYSTRUCTURE", "UID",
        # "BODY [".PEEK"] [<section>] ["<" <number> "." <nz_number> ">"]

        l = s.lower()
        for (name, cls) in self._simple_fetch_att:
            if l.startswith(name):
                self.result.append(cls())
                return len(name)

        b = self.Body()
        if l.startswith('body.peek'):
            b.peek = True
            used = 9
        elif l.startswith('body'):
            used = 4
        else:
            raise Exception("Nothing recognized in fetch_att: %s" % (l,))

        self.pending_body = b
        self.state.extend(('got_body', 'maybe_partial', 'maybe_section'))
        return used
dataset/ETHPy150Open nlloyd/SubliminalCollaborator/libs/twisted/mail/imap4.py/_FetchParser.state_fetch_att/original