]> khamidou — GitHub mirrors - imapclient.git/commitdiff
Document the livetest/interact INI file format
authorMenno Smits <menno@freshfoo.com>
Wed, 17 Aug 2016 10:59:43 +0000 (22:59 +1200)
committerMenno Smits <menno@freshfoo.com>
Wed, 17 Aug 2016 10:59:43 +0000 (22:59 +1200)
Closes #193.

--HG--
branch : stable

README.rst
doc/src/index.rst
doc/src/releases.rst

index b9ff8baec56c607d4f6859a93d5dd8a13cccf3a0..8f2b866265106361e8c2164e27ccee52e5bd71c1 100644 (file)
@@ -17,7 +17,7 @@ Features:
 - Convenience methods are provided for commonly used functionality.
 - Exceptions are raised when errors occur.
 
-Python versions 2.6, 2.7, 3.3 and 3.4 are officially supported.
+Python versions 2.6, 2.7, 3.3, 3.4 and 3.5 are officially supported.
 
 The current stable version of IMAPClient is 1.0.1. It is licensed
 under the New BSD License.
@@ -159,12 +159,13 @@ compatibility with a given IMAP server implementation.
 
 The livetest functionality can also be accessed like this::
 
-    python -m imapclient.livetest ...
+    python -m imapclient.livetest <livetest.ini> [ optional unittest arguments ]
 
 Alternatively you can run the ``livetest.py`` script included with the
-source distribution.
+source distribution. Use ``livetest.py --help`` to see usage.
 
-Use the --help option to see usage.
+The configuration file format is
+`described in the main documentation <http://imapclient.rtfd.io/#configuration-file-format>`_.
 
 **WARNING**: The operations used by livetest are destructive and could
 cause unintended loss of data. That said, as of version 0.9, livetest
index 7646a75c4fcd51fd7bf3f4029958ecee45a074f0..a84bf4279d33815f4f123b97054967a1c7375d1b 100644 (file)
@@ -273,12 +273,18 @@ Various options are available to specify the IMAP server details. See
 the help (--help) for more details. You'll be prompted for a username
 and password if one isn't provided on the command line.
 
-The connected IMAPClient instance is available as the variable "c".
+It is also possible to pass connection details as a configuration file
+like this::
+
+   python -m imapclient.interact -f <config file>
+
+See below for details of the :ref:`configuration file format<conf-files>`.
 
 If installed, IPython will be used as the embedded shell. Otherwise
 the basic built-in Python shell will be used.
 
-Here's an example session::
+The connected IMAPClient instance is available as the variable
+"c". Here's an example session::
 
     $ python -m imapclient.interact -H <host> -u <user> ...
     Connecting...
@@ -309,6 +315,48 @@ Here's an example session::
     In [3]: c.logout()
     Out[3]: b'Logging out'
 
+.. _conf-files:
+
+Configuration File Format
+-------------------------
+Both the IMAPClient interactive shell and the live tests take
+configuration files which specify how to to connect to an IMAP
+server. The configuration file format is the same for both.
+
+Configuration files use the INI format and must always have a section
+called ``DEFAULT``. Here's a simple example::
+
+    [DEFAULT]
+    host = imap.mailserver.com
+    username = bob
+    password = sekret
+    ssl = True
+
+The supported options are:
+
+==================== ======= =========================================================================================
+Name                 Type    Description
+==================== ======= =========================================================================================
+host                 string  IMAP hostname to connect to.
+username             string  The username to authenticate as.
+password             string  The password to use with ``username``.
+port                 int     Server port to connect to. Defaults to 143 unless ``ssl`` is True.
+ssl                  bool    Use SSL/TLS to connect.
+starttls             bool    Use STARTTLS to connect.
+ssl_check_hostname   bool    If true and SSL is in use, check that certificate matches the hostname (defaults to true)
+ssl_verify_cert      bool    If true and SSL is in use, check that the certifcate is valid (defaults to true).
+ssl_ca_file          string  If SSL is true, use this to specify certificate authority certs to validate with.
+timeout              int     Time out I/O operations after this many seconds.
+oauth2               bool    If true, use OAUTH2 to authenticate (``username`` and ``password`` are ignored).
+oauth2_client_id     string  OAUTH2 client id.
+oauth2_client_secret string  OAUTH2 client secret.
+oauth2_refresh_token string  OAUTH2 token for refreshing the secret.
+==================== ======= =========================================================================================
+
+Acceptable boolean values are "1", "yes", "true", and "on", for true;
+and "0", "no", "false", and "off", for false.
+
+
 External Documentation
 ----------------------
 The `Unofficial IMAP Protocol Wiki <http://www.imapwiki.org/>`_ is
index 8850c01e48e355588c13ae702468b3d2d39e19ce..fb8022a445771e6277734c284aa12c4166818383 100644 (file)
@@ -4,6 +4,10 @@
  Version 1.0.2
 ===============
 
+New
+---
+- Documented the livetest/interact INI file format.
+
 Changed
 -------
 - Explicitly check that the required pyOpenSSL version is installed