summaryrefslogtreecommitdiffstats
path: root/doc/usage/advanced/websupport/storagebackends.rst
blob: ccb00b63cedd15623e6a76d7c9fc24ae1b26bc52 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
.. _storagebackends:

.. currentmodule:: sphinxcontrib.websupport.storage

Storage Backends
================

To create a custom storage backend you will need to subclass the
:class:`StorageBackend` class.  Then create an instance of the new class and
pass that as the `storage` keyword argument when you create the
:class:`~.WebSupport` object::

   support = WebSupport(srcdir=srcdir,
                        builddir=builddir,
                        storage=MyStorage())

For more information about creating a custom storage backend, please see the
documentation of the :class:`StorageBackend` class below.

.. class:: StorageBackend

   Defines an interface for storage backends.

.. versionchanged:: 1.6

   StorageBackend class is moved to sphinxcontrib.websupport.storage from
   sphinx.websupport.storage.


Methods
-------

.. automethod:: StorageBackend.pre_build

.. automethod:: StorageBackend.add_node

.. automethod:: StorageBackend.post_build

.. automethod:: StorageBackend.add_comment

.. automethod:: StorageBackend.delete_comment

.. automethod:: StorageBackend.get_data

.. automethod:: StorageBackend.process_vote

.. automethod:: StorageBackend.update_username

.. automethod:: StorageBackend.accept_comment