(cls, path, **kwargs)
| 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): |
nothing calls this directly
no test coverage detected