Execute "command arg ..." with messages identified by UID, rather than message number. (typ, [data]) = .uid(command, arg1, arg2, ...) Returns response appropriate to 'command'.
(self, command, *args)
| 871 | |
| 872 | |
| 873 | def uid(self, command, *args): |
| 874 | """Execute "command arg ..." with messages identified by UID, |
| 875 | rather than message number. |
| 876 | |
| 877 | (typ, [data]) = <instance>.uid(command, arg1, arg2, ...) |
| 878 | |
| 879 | Returns response appropriate to 'command'. |
| 880 | """ |
| 881 | command = command.upper() |
| 882 | if not command in Commands: |
| 883 | raise self.error("Unknown IMAP4 UID command: %s" % command) |
| 884 | if self.state not in Commands[command]: |
| 885 | raise self.error("command %s illegal in state %s, " |
| 886 | "only allowed in states %s" % |
| 887 | (command, self.state, |
| 888 | ', '.join(Commands[command]))) |
| 889 | name = 'UID' |
| 890 | typ, dat = self._simple_command(name, command, *args) |
| 891 | if command in ('SEARCH', 'SORT', 'THREAD'): |
| 892 | name = command |
| 893 | else: |
| 894 | name = 'FETCH' |
| 895 | return self._untagged_response(typ, dat, name) |
| 896 | |
| 897 | |
| 898 | def unsubscribe(self, mailbox): |
nothing calls this directly
no test coverage detected