MCPcopy
hub / github.com/pimutils/vdirsyncer / discover

Method discover

vdirsyncer/storage/filesystem.py:32–48  ·  view source on GitHub ↗
(cls, path, **kwargs)

Source from the content-addressed store, hash-verified

30
31 @classmethod
32 def discover(cls, path, **kwargs):
33 if kwargs.pop('collection', None) is not None:
34 raise TypeError('collection argument must not be given.')
35 path = expand_path(path)
36 try:
37 collections = os.listdir(path)
38 except OSError as e:
39 if e.errno != errno.ENOENT:
40 raise
41 else:
42 for collection in collections:
43 collection_path = os.path.join(path, collection)
44 if not cls._validate_collection(collection_path):
45 continue
46 args = dict(collection=collection, path=collection_path,
47 **kwargs)
48 yield args
49
50 @classmethod
51 def _validate_collection(cls, path):

Callers

nothing calls this directly

Calls 3

expand_pathFunction · 0.85
joinMethod · 0.80
_validate_collectionMethod · 0.80

Tested by

no test coverage detected