Skip to content

Commit decd64f

Browse files
committed
Make the documentation being on several pages and improve root files layout
1 parent 3213fff commit decd64f

File tree

10 files changed

+430
-439
lines changed

10 files changed

+430
-439
lines changed

AUTHORS

Lines changed: 0 additions & 2 deletions
This file was deleted.

AUTHORS.rst

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
IMAPClient was created and is maintained by Menno Finlay-Smits <[email protected]>.
2+
Thanks go to the following people for their help with this project.
3+
4+
- Mathieu Agopian
5+
- Chris Arndt
6+
- Jp Calderone
7+
- John Louis del Rosario
8+
- Dave Eckhardt
9+
- Eben Freeman
10+
- Helder Guerreiro
11+
- Mark Hammond <mhammond _AT_ skipinet.com.au>
12+
- Johannes Heckel
13+
- Thomas Jost <schnouki _AT_ schnouki.net>
14+
- Maxime Lorant
15+
- Lukasz Mierzwa
16+
- Naveen Nathan
17+
- Brian Neal
18+
- Phil Peterson
19+
- Aviv Salem
20+
- Andrew Scheller
21+
- Thomas Steinacher
22+
- Zac Witte

README.rst

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -71,17 +71,7 @@ via PyPI use the pip or easy_install tools::
7171

7272
easy_install IMAPClient
7373

74-
The source distributions of all IMAPClient versions are available at
75-
http://menno.io/projects/IMAPClient/. Alternatively you can also use
76-
the PyPI page at https://pypi.python.org/pypi/IMAPClient/.
77-
78-
To install from source run::
79-
80-
python setup.py install
81-
82-
The project is packaged using Distribute (mostly compatible with
83-
setuptools) and all the usual setup.py installation options are
84-
available. See http://packages.python.org/distribute/ for more info.
74+
More installation methods are described in the documentation.
8575

8676
Documentation
8777
-------------

THANKS

Lines changed: 0 additions & 96 deletions
This file was deleted.

doc/src/advanced.rst

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
Advanced Usage
2+
--------------
3+
This document covers some more advanced features and tips for handling
4+
specific usages.
5+
6+
Watching a mailbox asynchronously using idle
7+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
8+
TODO
9+
10+
Handling large mailboxes
11+
~~~~~~~~~~~~~~~~~~~~~~~~
12+
TODO
13+
14+
Interactive Sessions
15+
~~~~~~~~~~~~~~~~~~~~
16+
When developing program using IMAPClient is it sometimes useful to
17+
have an interactive shell to play with. IMAPClient ships with a module
18+
that lets you fire up an interactive shell with an IMAPClient instance
19+
connected to an IMAP server.
20+
21+
Start a session like this::
22+
23+
python -m imapclient.interact -H <host> -u <user> ...
24+
25+
Various options are available to specify the IMAP server details. See
26+
the help (--help) for more details. You'll be prompted for a username
27+
and password if one isn't provided on the command line.
28+
29+
It is also possible to pass connection details as a configuration file
30+
like this::
31+
32+
python -m imapclient.interact -f <config file>
33+
34+
See below for details of the :ref:`configuration file format<conf-files>`.
35+
36+
If installed, IPython will be used as the embedded shell. Otherwise
37+
the basic built-in Python shell will be used.
38+
39+
The connected IMAPClient instance is available as the variable
40+
"c". Here's an example session::
41+
42+
$ python -m imapclient.interact -H <host> -u <user> ...
43+
Connecting...
44+
Connected.
45+
46+
IMAPClient instance is "c"
47+
In [1]: c.select_folder('inbox')
48+
Out[1]:
49+
{b'EXISTS': 2,
50+
b'FLAGS': (b'\\Answered',
51+
b'\\Flagged',
52+
b'\\Deleted',
53+
b'\\Seen',
54+
b'\\Draft'),
55+
b'PERMANENTFLAGS': (b'\\Answered',
56+
b'\\Flagged',
57+
b'\\Deleted',
58+
b'\\Seen',
59+
b'\\Draft'),
60+
b'READ-WRITE': True,
61+
b'RECENT': 0,
62+
b'UIDNEXT': 1339,
63+
b'UIDVALIDITY': 1239278212}
64+
65+
In [2]: c.search()
66+
Out[2]: [1123, 1233]
67+
68+
In [3]: c.logout()
69+
Out[3]: b'Logging out'
70+
71+
72+
.. _conf-files:
73+
74+
Configuration File Format
75+
+++++++++++++++++++++++++
76+
Both the IMAPClient interactive shell and the live tests take
77+
configuration files which specify how to to connect to an IMAP
78+
server. The configuration file format is the same for both.
79+
80+
Configuration files use the INI format and must always have a section
81+
called ``DEFAULT``. Here's a simple example::
82+
83+
[DEFAULT]
84+
host = imap.mailserver.com
85+
username = bob
86+
password = sekret
87+
ssl = True
88+
89+
The supported options are:
90+
91+
==================== ======= =========================================================================================
92+
Name Type Description
93+
==================== ======= =========================================================================================
94+
host string IMAP hostname to connect to.
95+
username string The username to authenticate as.
96+
password string The password to use with ``username``.
97+
port int Server port to connect to. Defaults to 143 unless ``ssl`` is True.
98+
ssl bool Use SSL/TLS to connect.
99+
starttls bool Use STARTTLS to connect.
100+
ssl_check_hostname bool If true and SSL is in use, check that certificate matches the hostname (defaults to true)
101+
ssl_verify_cert bool If true and SSL is in use, check that the certifcate is valid (defaults to true).
102+
ssl_ca_file string If SSL is true, use this to specify certificate authority certs to validate with.
103+
timeout int Time out I/O operations after this many seconds.
104+
oauth2 bool If true, use OAUTH2 to authenticate (``username`` and ``password`` are ignored).
105+
oauth2_client_id string OAUTH2 client id.
106+
oauth2_client_secret string OAUTH2 client secret.
107+
oauth2_refresh_token string OAUTH2 token for refreshing the secret.
108+
==================== ======= =========================================================================================
109+
110+
Acceptable boolean values are "1", "yes", "true", and "on", for true;
111+
and "0", "no", "false", and "off", for false.

doc/src/api.rst

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
IMAPClient Class
2+
~~~~~~~~~~~~~~~~
3+
The primary class used by the imapclient package is the IMAPClient
4+
class. All interaction with a remote IMAP server is performed via an
5+
IMAPClient instance.
6+
7+
.. autoclass:: imapclient.IMAPClient
8+
:members:
9+
10+
Fetch Response Types
11+
~~~~~~~~~~~~~~~~~~~~
12+
Various types may be used in the data structures returned by
13+
:py:meth:`.IMAPClient.fetch` when certain response types
14+
are encountered during parsing.
15+
16+
.. automodule:: imapclient.response_types
17+
:members:
18+
19+
Exceptions
20+
~~~~~~~~~~
21+
The following exceptions may be raised by IMAPClient directly. They
22+
are attached to the IMAPClient class.
23+
24+
* IMAPClient.Error: the base class for IMAPClient's exceptions and the
25+
most commonly used error.
26+
* IMAPClient.AbortError: raised if a serious error has occurred that
27+
means the IMAP connection is no longer usable. The connection should
28+
be dropped without logout if this occurs.
29+
* IMAPClient.ReadOnlyError: raised if a modifying operation was
30+
attempted on a read-only folder.
31+
32+
Exceptions from lower network layers are also possible, in particular:
33+
34+
* socket.error
35+
* socket.timeout: raised if a timeout was specified when creating the
36+
IMAPClient instance and a network operation takes too long.
37+
* backports.ssl.SSLError: the base class for network or SSL protocol
38+
errors when ssl=True or starttls() is used.
39+
* backports.ssl.CertificateError: raised when TLS certification
40+
verification fails. This is *not* a subclass of SSLError.
41+
42+
43+
TLS Support
44+
~~~~~~~~~~~
45+
46+
.. automodule:: imapclient.tls
47+
:members:

0 commit comments

Comments
 (0)