1
= How to write a backend, in five easy steps! =
3
There are five main methods you want to implement:
5
__init__ - Initial setup
8
_list - List all files in the backend
9
_delete - Delete one file
11
There are other methods you may optionally implement:
23
Always subclass from duplicity.backend.Backend
27
You can register your class as a single backend like so:
29
duplicity.backend.register_backend("foo", FooBackend)
31
This will allow a URL like so: foo://hostname/path
33
Or you can register your class as a meta backend like so:
34
duplicity.backend.register_prefix_backend("bar", BarBackend)
36
Which will allow a URL like so: bar+foo://hostname/path and your class will
37
be passed the inner URL to either interpret how you like or create a new
38
inner backend instance with duplicity.backend.get_backend(url).
42
When writing helper methods for your class, please prefix them with two
43
underscores. While you can define other no- or single-underscore prefixed
44
methods, we don't guarantee that that method name won't later be used
45
by the main Backend class.