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)
| 973 | |
| 974 | |
| 975 | def uid(self, command, *args): |
| 976 | """Execute "command arg ..." with messages identified by UID, |
| 977 | rather than message number. |
| 978 | |
| 979 | (typ, [data]) = <instance>.uid(command, arg1, arg2, ...) |
| 980 | |
| 981 | Returns response appropriate to 'command'. |
| 982 | """ |
| 983 | command = command.upper() |
| 984 | if not command in Commands: |
| 985 | raise self.error("Unknown IMAP4 UID command: %s" % command) |
| 986 | if self.state not in Commands[command]: |
| 987 | raise self.error("command %s illegal in state %s, " |
| 988 | "only allowed in states %s" % |
| 989 | (command, self.state, |
| 990 | ', '.join(Commands[command]))) |
| 991 | name = 'UID' |
| 992 | typ, dat = self._simple_command(name, command, *args) |
| 993 | if command in ('SEARCH', 'SORT', 'THREAD'): |
| 994 | name = command |
| 995 | else: |
| 996 | name = 'FETCH' |
| 997 | return self._untagged_response(typ, dat, name) |
| 998 | |
| 999 | |
| 1000 | def unsubscribe(self, mailbox): |
nothing calls this directly
no test coverage detected