Changeset 275:4465b569eab0
- Timestamp:
- 08/11/11 22:13:56 (7 months ago)
- Author:
- Menno Smits <menno@…>
- Branch:
- default
- Message:
-
doc updates to cover interact and livetest changes
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r269
|
r275
|
|
| 35 | 35 | -------------- |
| 36 | 36 | * interact.py can now read livetest.py INI files (#66) |
| | 37 | * interact.py can now embed shells from ipython 0.10 and 0.11 (#98) |
| | 38 | * interact.py and livetest.py are now inside the imapclient package so |
| | 39 | they can be used even when IMAClient has been installed from PyPI |
| | 40 | (#82) |
| 37 | 41 | * Added "debug" propety and setting of a log file (#90) |
| 38 | 42 | * "normalise_times" attribute allows caller to select whether |
-
|
r264
|
r275
|
|
| 111 | 111 | code.interact() function from the standard library is used. |
| 112 | 112 | |
| | 113 | The interact functionality can also be accessed like this: |
| | 114 | |
| | 115 | python -m imapclient.interact ... |
| | 116 | |
| | 117 | This works when IMAPClient has been installed from PyPI. |
| | 118 | |
| 113 | 119 | |
| 114 | 120 | livetest.py |
| … |
… |
|
| 132 | 138 | of the IMAP server. |
| 133 | 139 | |
| | 140 | The livetest functionality can also be accessed like this: |
| | 141 | |
| | 142 | python -m imapclient.livetest ... |
| | 143 | |
| | 144 | This works when IMAPClient has been installed from PyPI. |
| | 145 | |
| 134 | 146 | |
| 135 | 147 | Unit Tests |
-
|
r260
|
r275
|
|
| 153 | 153 | :members: |
| 154 | 154 | |
| 155 | | |
| | 155 | Interactive Sessions |
| | 156 | -------------------- |
| | 157 | When developing program using IMAPClient is it sometimes useful to |
| | 158 | have an interactive shell to play with. IMAPClient ships with a module |
| | 159 | that lets you fire up an interactive shell with an IMAPClient instance |
| | 160 | connected to an IMAP server. |
| | 161 | |
| | 162 | Start a session like this:: |
| | 163 | |
| | 164 | python -m imapclient.interact -H <host> -u <user> ... |
| | 165 | |
| | 166 | Various options are available to specify the IMAP server details. See |
| | 167 | the help (--help) for more details. You'll be prompted for a username |
| | 168 | and password if one isn't provided on the command line. |
| | 169 | |
| | 170 | If installed, IPython will be used as the embedded shell. Otherwise |
| | 171 | the basic built-in Python shell will be used. |
| | 172 | |
| | 173 | Here's an example session:: |
| | 174 | |
| | 175 | $ python -m imapclient.interact -H <host> -u <user> ... |
| | 176 | Connecting... |
| | 177 | Connected. |
| | 178 | |
| | 179 | IMAPClient instance is "c" |
| | 180 | In [1]: c.select_folder('inbox') |
| | 181 | Out[1]: |
| | 182 | {'EXISTS': 2, |
| | 183 | 'FLAGS': ('\\Answered', |
| | 184 | '\\Flagged', |
| | 185 | '\\Deleted', |
| | 186 | '\\Seen', |
| | 187 | '\\Draft'), |
| | 188 | 'PERMANENTFLAGS': ('\\Answered', |
| | 189 | '\\Flagged', |
| | 190 | '\\Deleted', |
| | 191 | '\\Seen', |
| | 192 | '\\Draft'), |
| | 193 | 'READ-WRITE': True, |
| | 194 | 'RECENT': 0, |
| | 195 | 'UIDNEXT': 1339, |
| | 196 | 'UIDVALIDITY': 1239278212} |
| | 197 | |
| | 198 | In [2]: c.search() |
| | 199 | Out[2]: [1123, 1233] |
| | 200 | |
| | 201 | In [3]: c.logout() |
| | 202 | Out[3]: 'Logging out' |
| | 203 | |
| | 204 | Note that the connected IMAPClient instance is available as the variable "c". |