@@ -115,9 +115,6 @@ class RemoteStorage(Storage):
115
115
def __init__ (self , account , verify = True , verify_fingerprint = None ,
116
116
auth_cert = None , access_token = None , ** kwargs ):
117
117
super (RemoteStorage , self ).__init__ (** kwargs )
118
- if not self .collection :
119
- raise ValueError ('collection must not be null.' )
120
-
121
118
self .session = Session (
122
119
account = account ,
123
120
verify = verify ,
@@ -234,6 +231,17 @@ class RemoteStorageContacts(RemoteStorage):
234
231
item_mimetype = 'text/vcard'
235
232
scope = 'vdir_contacts'
236
233
234
+ def __init__ (self , ** kwargs ):
235
+ if kwargs .get ('collection' ):
236
+ raise ValueError (
237
+ 'No collections allowed for contacts, '
238
+ 'there is only one addressbook. '
239
+ 'Use the vcard groups construct to categorize your contacts '
240
+ 'into groups.'
241
+ )
242
+
243
+ super (RemoteStorageContacts , self ).__init__ (** kwargs )
244
+
237
245
238
246
class RemoteStorageCalendars (RemoteStorage ):
239
247
__doc__ = '''
@@ -244,3 +252,9 @@ class RemoteStorageCalendars(RemoteStorage):
244
252
fileext = '.ics'
245
253
item_mimetype = 'text/icalendar'
246
254
scope = 'vdir_calendars'
255
+
256
+ def __init__ (self , ** kwargs ):
257
+ if not kwargs .get ('collection' ):
258
+ raise ValueError ('The collections parameter is required.' )
259
+
260
+ super (RemoteStorageCalendars , self ).__init__ (** kwargs )
0 commit comments