Changeset 275:4465b569eab0

Show
Ignore:
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:
3 modified

Legend:

Unmodified
Added
Removed
  • NEWS

    r269 r275  
    3535-------------- 
    3636* 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) 
    3741* Added "debug" propety and setting of a log file (#90) 
    3842* "normalise_times" attribute allows caller to select whether 
  • README

    r264 r275  
    111111code.interact() function from the standard library is used. 
    112112 
     113The interact functionality can also be accessed like this: 
     114 
     115    python -m imapclient.interact ... 
     116 
     117This works when IMAPClient has been installed from PyPI. 
     118 
    113119 
    114120livetest.py 
     
    132138of the IMAP server. 
    133139 
     140The livetest functionality can also be accessed like this: 
     141 
     142    python -m imapclient.livetest ... 
     143 
     144This works when IMAPClient has been installed from PyPI. 
     145 
    134146 
    135147Unit Tests 
  • doc/src/index.rst

    r260 r275  
    153153   :members: 
    154154 
    155  
     155Interactive Sessions 
     156-------------------- 
     157When developing program using IMAPClient is it sometimes useful to 
     158have an interactive shell to play with. IMAPClient ships with a module 
     159that lets you fire up an interactive shell with an IMAPClient instance 
     160connected to an IMAP server. 
     161 
     162Start a session like this:: 
     163 
     164   python -m imapclient.interact -H <host> -u <user> ... 
     165 
     166Various options are available to specify the IMAP server details. See 
     167the help (--help) for more details. You'll be prompted for a username 
     168and password if one isn't provided on the command line. 
     169 
     170If installed, IPython will be used as the embedded shell. Otherwise 
     171the basic built-in Python shell will be used. 
     172 
     173Here'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 
     204Note that the connected IMAPClient instance is available as the variable "c".