MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / select

Method select

tools/python-3.11.9-amd64/Lib/imaplib.py:738–767  ·  view source on GitHub ↗

Select a mailbox. Flush all untagged responses. (typ, [data]) = .select(mailbox='INBOX', readonly=False) 'data' is count of messages in mailbox ('EXISTS' response). Mandated responses are ('FLAGS', 'EXISTS', 'RECENT', 'UIDVALIDITY'), so

(self, mailbox='INBOX', readonly=False)

Source from the content-addressed store, hash-verified

736
737
738 def select(self, mailbox='INBOX', readonly=False):
739 """Select a mailbox.
740
741 Flush all untagged responses.
742
743 (typ, [data]) = <instance>.select(mailbox='INBOX', readonly=False)
744
745 'data' is count of messages in mailbox ('EXISTS' response).
746
747 Mandated responses are ('FLAGS', 'EXISTS', 'RECENT', 'UIDVALIDITY'), so
748 other responses should be obtained via <instance>.response('FLAGS') etc.
749 """
750 self.untagged_responses = {} # Flush old responses.
751 self.is_readonly = readonly
752 if readonly:
753 name = 'EXAMINE'
754 else:
755 name = 'SELECT'
756 typ, dat = self._simple_command(name, mailbox)
757 if typ != 'OK':
758 self.state = 'AUTH' # Might have been 'SELECTED'
759 return typ, dat
760 self.state = 'SELECTED'
761 if 'READ-ONLY' in self.untagged_responses \
762 and not readonly:
763 if __debug__:
764 if self.debug >= 1:
765 self._dump_ur(self.untagged_responses)
766 raise self.readonly('%s is not writable' % mailbox)
767 return typ, self.untagged_responses.get('EXISTS', [None])
768
769
770 def setacl(self, mailbox, who, what):

Callers 9

serve_until_quitMethod · 0.45
read_untilMethod · 0.45
sock_availMethod · 0.45
interactMethod · 0.45
expectMethod · 0.45
_communicateMethod · 0.45
pollFunction · 0.45
serve_foreverMethod · 0.45
handle_requestMethod · 0.45

Calls 3

_simple_commandMethod · 0.95
_dump_urMethod · 0.95
getMethod · 0.45

Tested by

no test coverage detected