Return the referenced shared folder
(params, shared_folder_uid)
| 281 | |
| 282 | |
| 283 | def get_shared_folder(params, shared_folder_uid): # type: (KeeperParams, str) -> Optional[SharedFolder] |
| 284 | """Return the referenced shared folder""" |
| 285 | shared_folder_uid = shared_folder_uid.strip() |
| 286 | |
| 287 | if not shared_folder_uid: |
| 288 | logging.warning('No shared folder UID provided') |
| 289 | return None |
| 290 | |
| 291 | if not params.shared_folder_cache: |
| 292 | logging.warning('No shared folder cache. Sync down first.') |
| 293 | return None |
| 294 | |
| 295 | if shared_folder_uid not in params.shared_folder_cache: |
| 296 | logging.warning('Shared folder UID not found.') |
| 297 | return None |
| 298 | |
| 299 | cached_sf = params.shared_folder_cache[shared_folder_uid] |
| 300 | |
| 301 | sf = SharedFolder(shared_folder_uid) |
| 302 | sf.load(cached_sf, cached_sf['revision']) |
| 303 | return sf |
| 304 | |
| 305 | def get_share_objects(params): # type: (KeeperParams) -> Dict[str, Dict[str, Any]] |
| 306 | if not params.share_object_cache: |
no test coverage detected