API.rst 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. .. OfflineImap API documentation
  2. .. currentmodule:: offlineimap
  3. .. _API docs:
  4. :mod:`offlineimap's` API documentation
  5. ======================================
  6. Within :mod:`offlineimap`, the classes :class:`OfflineImap` provides the
  7. high-level functionality. The rest of the classes should usually not needed to
  8. be touched by the user. Email repositories are represented by a
  9. :class:`offlineimap.repository.Base.BaseRepository` or derivatives (see
  10. :mod:`offlineimap.repository` for details). A folder within a repository is
  11. represented by a :class:`offlineimap.folder.Base.BaseFolder` or any derivative
  12. from :mod:`offlineimap.folder`.
  13. This page contains the main API overview of OfflineImap |release|.
  14. OfflineImap can be imported as::
  15. from offlineimap import OfflineImap
  16. :mod:`offlineimap` -- The OfflineImap module
  17. =============================================
  18. .. module:: offlineimap
  19. .. autoclass:: offlineimap.OfflineImap(cmdline_opts = None)
  20. :members:
  21. :inherited-members:
  22. :undoc-members:
  23. :private-members:
  24. :class:`offlineimap.account`
  25. ============================
  26. An :class:`accounts.Account` connects two email repositories that are to be
  27. synced. It comes in two flavors, normal and syncable.
  28. .. autoclass:: offlineimap.accounts.Account
  29. .. autoclass:: offlineimap.accounts.SyncableAccount
  30. :members:
  31. :inherited-members:
  32. .. autodata:: ui
  33. Contains the current :mod:`offlineimap.ui`, and can be used for logging etc.
  34. :exc:`OfflineImapError` -- A Notmuch execution error
  35. --------------------------------------------------------
  36. .. autoexception:: offlineimap.error.OfflineImapError
  37. :members:
  38. This exception inherits directly from :exc:`Exception` and is raised
  39. on errors during the offlineimap execution. It has an attribute
  40. `severity` that denotes the severity level of the error.
  41. :mod:`offlineimap.globals` -- module with global variables
  42. ==========================================================
  43. Module `offlineimap.globals` provides the read-only storage
  44. for the global variables.
  45. All exported module attributes can be set manually, but this practice
  46. is highly discouraged and shouldn't be used.
  47. However, attributes of all stored variables can only be read, write
  48. access to them is denied.
  49. Currently, we have only :attr:`options` attribute that holds
  50. command-line options as returned by OptionParser.
  51. The value of :attr:`options` must be set by :func:`set_options`
  52. prior to its first use.
  53. .. automodule:: offlineimap.globals
  54. :members:
  55. .. data:: options
  56. You can access the values of stored options using the usual
  57. syntax, offlineimap.globals.options.<option-name>