MCPcopy Create free account
hub / github.com/Keeper-Security/Commander / SyncDownCommand

Class SyncDownCommand

keepercommander/commands/utils.py:481–519  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

479
480
481class SyncDownCommand(Command):
482 def get_parser(self):
483 return sync_down_parser
484
485 def execute(self, params, **kwargs):
486 force = kwargs.get('force') is True
487 if force:
488 params.revision = 0
489 params.sync_down_token = b''
490 if params.config:
491 if 'skip_records' in params.config:
492 del params.config['skip_records']
493
494 api.sync_down(params, record_types=force)
495 if force:
496 from ..loginv3 import LoginV3Flow
497 LoginV3Flow.populateAccountSummary(params)
498
499 accepted = False
500 if len(params.pending_share_requests) > 0:
501 for user in params.pending_share_requests:
502 accepted = False
503 logging.info('Note: You have pending share request from ' + user)
504 answer = user_choice('Do you want to accept these request?', 'yn', 'n')
505 rq = {
506 'command': 'accept_share' if answer == 'y' else 'cancel_share',
507 'from_email': user
508 }
509 try:
510 rs = api.communicate(params, rq)
511 if rs['result'] == 'success':
512 accepted = accepted or answer == 'y'
513 except Exception as e:
514 logging.debug('Accept share exception: %s', e)
515
516 params.pending_share_requests.clear()
517
518 if accepted:
519 params.sync_data = True
520
521
522class ThisDeviceCommand(Command):

Callers 6

register_commandsFunction · 0.85
executeMethod · 0.85
executeMethod · 0.85
_execute_supershellMethod · 0.85
on_mountMethod · 0.85
action_sync_vaultMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected