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