|
73 | 73 | 'GETANNOTATION':('AUTH', 'SELECTED'), |
74 | 74 | 'GETQUOTA': ('AUTH', 'SELECTED'), |
75 | 75 | 'GETQUOTAROOT': ('AUTH', 'SELECTED'), |
| 76 | + 'ID': ('NONAUTH', 'AUTH', 'SELECTED', 'LOGOUT'), |
76 | 77 | 'IDLE': ('AUTH', 'SELECTED'), |
77 | 78 | 'MYRIGHTS': ('AUTH', 'SELECTED'), |
78 | 79 | 'LIST': ('AUTH', 'SELECTED'), |
@@ -695,6 +696,28 @@ def getquotaroot(self, mailbox): |
695 | 696 | return typ, [quotaroot, quota] |
696 | 697 |
|
697 | 698 |
|
| 699 | + def id(self, fields=None): |
| 700 | + """Send client identification information to the server. |
| 701 | +
|
| 702 | + (typ, [data]) = <instance>.id(fields) |
| 703 | +
|
| 704 | + 'fields' is a mapping of field names to values; a value can be |
| 705 | + None. 'data' is the identification information sent back by |
| 706 | + the server, in the same parenthesized list form. |
| 707 | + """ |
| 708 | + name = 'ID' |
| 709 | + if fields: |
| 710 | + items = [] |
| 711 | + for field, value in fields.items(): |
| 712 | + items.append(self._quote(field)) |
| 713 | + items.append(b'NIL' if value is None else self._quote(value)) |
| 714 | + arg = b'(' + b' '.join(items) + b')' |
| 715 | + else: |
| 716 | + arg = 'NIL' |
| 717 | + typ, dat = self._simple_command(name, arg) |
| 718 | + return self._untagged_response(typ, dat, name) |
| 719 | + |
| 720 | + |
698 | 721 | def idle(self, duration=None): |
699 | 722 | """Return an iterable IDLE context manager producing untagged responses. |
700 | 723 | If the argument is not None, limit iteration to 'duration' seconds. |
|
0 commit comments