@@ -52,6 +52,9 @@ class Storage(metaclass=StorageMeta):
52
52
53
53
:param read_only: Whether the synchronization algorithm should avoid writes
54
54
to this storage. Some storages accept no value other than ``True``.
55
+ :param implicit: Whether the synchronization shall create/delete collections
56
+ in the destination, when these were created/removed from the source. Must
57
+ be a possibly empty list of strings.
55
58
"""
56
59
57
60
fileext = ".txt"
@@ -75,9 +78,16 @@ class Storage(metaclass=StorageMeta):
75
78
# The attribute values to show in the representation of the storage.
76
79
_repr_attributes : List [str ] = []
77
80
78
- def __init__ (self , instance_name = None , read_only = None , collection = None ):
81
+ def __init__ (self , instance_name = None , read_only = None , collection = None ,
82
+ implicit = None ):
79
83
if read_only is None :
80
84
read_only = self .read_only
85
+ if implicit is None :
86
+ self .implicit = []
87
+ elif isinstance (implicit , str ):
88
+ self .implicit = [implicit ]
89
+ else :
90
+ self .implicit = implicit
81
91
if self .read_only and not read_only :
82
92
raise exceptions .UserError ("This storage can only be read-only." )
83
93
self .read_only = bool (read_only )
@@ -119,6 +129,18 @@ async def create_collection(cls, collection, **kwargs):
119
129
"""
120
130
raise NotImplementedError
121
131
132
+ @classmethod
133
+ def delete_collection (cls , collection , ** kwargs ):
134
+ '''
135
+ Delete the specified collection and return the new arguments.
136
+
137
+ ``collection=None`` means the arguments are already pointing to a
138
+ possible collection location.
139
+
140
+ The returned args should contain the collection name, for UI purposes.
141
+ '''
142
+ raise NotImplementedError ()
143
+
122
144
def __repr__ (self ):
123
145
try :
124
146
if self .instance_name :
0 commit comments