Changeset 250:1fdb2f77fb2a

Show
Ignore:
Timestamp:
05/06/11 17:45:04 (12 months ago)
Author:
Menno Smits <menno@…>
Branch:
default
Message:

Fixed up documentation for recently added functionality

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • imapclient/imapclient.py

    r249 r250  
    6666    If *ssl* is ``True`` an SSL connection will be made (defaults to 
    6767    ``False``). 
     68 
     69    The *debug* property can be used to enable debug logging. It can 
     70    be set to an integer from 0 to 5 where 0 disables debug output and 
     71    5 enables full output with wire logging and parsing logs. ``True`` 
     72    and ``False`` can also be assigned where ``True`` sets debug level 
     73    4. 
     74 
     75    By default, debug output goes to stderr. The *log_file* attribute 
     76    can be assigned to an alternate file handle for writing debug 
     77    output to. 
    6878    """ 
    6979 
     
    105115    def oauth_login(self, url, oauth_token, oauth_token_secret, 
    106116                    consumer_key='anonymous', consumer_secret='anonymous'): 
    107         """Authenticate using oauth. 
    108  
    109         @param url: The OAuth request URL. 
    110         @param oauth_token: An OAuth key. 
    111         @param oauth_token_secret: An OAuth secret. 
    112         @param consumer_key: An OAuth consumer key (defaults to 'anonymous'). 
    113         @param consumer_secret: An OAuth consumer secret (defaults to 'anonymous'). 
     117        """Authenticate using the OAUTH method. 
     118 
     119        This only works with IMAP servers that support OAUTH (eg. Gmail). 
    114120        """ 
    115121        if oauth2: 
     
    162168        *shared*. 
    163169 
    164         See RFC 2342 for more details. 
     170        See `RFC-2342 <http://tools.ietf.org/html/rfc2342>`_ for more details. 
    165171        """ 
    166172        typ, data = self._imap.namespace() 
     
    303309 
    304310    def idle(self): 
    305         """Put server into IDLE mode. 
     311        """Put the server into IDLE mode. 
    306312 
    307313        In this mode the server will return unsolicited responses 
    308         about changes to the selected mailbox. 
    309  
    310         This method returns immediately. Use idle_check() to check for 
    311         IDLE responses and idle_done() to stop IDLE mode. 
    312  
    313         Note: Any other commmands issued while the server is in IDLE 
    314         mode will fail. 
    315  
    316         See RFC 2177 for more information about the IDLE extension. 
    317         http://tools.ietf.org/html/rfc2177 
     314        about changes to the selected mailbox. This method returns 
     315        immediately. Use ``idle_check()`` to look for IDLE responses 
     316        and ``idle_done()`` to stop IDLE mode. 
     317 
     318        .. note:: 
     319 
     320            Any other commmands issued while the server is in IDLE 
     321            mode will fail. 
     322 
     323        See `RFC 2177 <http://tools.ietf.org/html/rfc2177>`_ for more 
     324        information about the IDLE extension. 
    318325        """ 
    319326        self._idle_tag = self._imap._command('IDLE') 
     
    326333 
    327334        This method should only be called if the server is in IDLE 
    328         mode (see idle()). 
     335        mode (see ``idle()``). 
    329336 
    330337        By default, this method will block until an IDLE response is 
    331         received. If timeout is provided, the call will block for at 
    332         most this number of seconds while waiting for an IDLE response. 
     338        received. If *timeout* is provided, the call will block for at 
     339        most this many seconds while waiting for an IDLE response. 
    333340 
    334341        The return value is a list of received IDLE responses. These 
    335342        will be parsed with values converted to appropriate types. For 
    336         example: 
    337  
    338         [('OK', 'Still here'), 
    339          (1, 'EXISTS'), 
    340          (1, 'FETCH', ('FLAGS', ('\\NotJunk',)))] 
     343        example:: 
     344 
     345            [('OK', 'Still here'), 
     346             (1, 'EXISTS'), 
     347             (1, 'FETCH', ('FLAGS', ('\\NotJunk',)))] 
    341348        """ 
    342349        # make the socket non-blocking so the timeout can be 
     
    365372        """Take the server out of IDLE mode. 
    366373 
    367         This method should only be called if the server is in IDLE mode. 
    368  
    369         The return value is (command_text, idle_responses) where 
    370         command_text is the text sent by the server when the IDLE 
    371         command finished (eg. 'Idle terminated') and idle_responses is 
    372         a list of parsed idle responses received since the last call 
    373         to idle_check() (if any). These are returned in parsed form as 
    374         per idle_check(). 
     374        This method should only be called if the server is already in 
     375        IDLE mode. 
     376 
     377        The return value is of the form ``(command_text, 
     378        idle_responses)`` where *command_text* is the text sent by the 
     379        server when the IDLE command finished (eg. ``'Idle 
     380        terminated'``) and *idle_responses* is a list of parsed idle 
     381        responses received since the last call to ``idle_check()`` (if 
     382        any). These are returned in parsed form as per 
     383        ``idle_check()``. 
    375384        """ 
    376385        self._imap.send('DONE\r\n') 
     
    788797        self._imap.debug = level 
    789798 
    790     debug = property(__debug_get, __debug_set, 
    791                      doc="Set debug level. Integers from 0 to 5 or, True and " \ 
    792                          "False can be used. True specifies debug level 4. " \ 
    793                          "Debug output goes to stderr.") 
     799    debug = property(__debug_get, __debug_set) 
    794800 
    795801    def _log(self, text):