-
Notifications
You must be signed in to change notification settings - Fork 1
Keeper fill implemented #100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: keeper-fill
Are you sure you want to change the base?
Conversation
|
|
||
| @staticmethod | ||
| def _format_url_for_display(url, verbose: bool) -> str: | ||
| """Format URL(s) for display, optionally truncating.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inconsistent static method calls — mixin methods are called both via self and _KeeperFillMixin. Standardize on self for consistency.
def _format_url_for_display(self, url, verbose: bool) -> str
| return _KeeperFillMixin._truncate_text(url) | ||
| elif isinstance(url, list) and url: | ||
| first_url = url[0] | ||
| return _KeeperFillMixin._truncate_text(first_url) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return self._truncate_text(first_url)
| return '' | ||
|
|
||
| if isinstance(url, str): | ||
| return _KeeperFillMixin._truncate_text(url) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return self._truncate_text(url)
|
|
||
| @staticmethod | ||
| def resolve_records(context: KeeperParams, **kwargs) -> Iterator[str]: | ||
| """ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def resolve_records(self, context: KeeperParams, **kwargs) -> Iterator[str]:
| records = set() | ||
|
|
||
| for path in paths: | ||
| record_uid = _KeeperFillMixin._try_resolve_as_record(vault_data, path) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
record_uid = self._try_resolve_as_record(vault_data, path)
| if not pattern: | ||
| folders.append(folder) | ||
| else: | ||
| records.update(_KeeperFillMixin._get_records_matching_pattern(vault_data, folder, pattern)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
records.update(self._get_records_matching_pattern(vault_data, folder, pattern))
|
|
||
| for folder in folders: | ||
| if recursive: | ||
| yield from _KeeperFillMixin._get_records_in_folder_tree(vault_data, folder) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yield from self._get_records_from_folder(vault_data, folder)
| yield from records | ||
|
|
||
| @staticmethod | ||
| def _get_records_in_folder_tree(vault_data, folder) -> Iterator[str]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def _get_records_in_folder_tree(self, vault_data, folder) -> Iterator[str]:
|
|
||
| @staticmethod | ||
| def get_keeper_fill_data(context: KeeperParams, record_uid: str) -> Optional[dict]: | ||
| """ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def get_keeper_fill_data(self, context: KeeperParams, record_uid: str) -> Optional[dict]:
adeshmukh-ks
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
keepercli implementations to be stopped going forward
Implemented "keeper-fill" command with it sub-command "list" and "set" for python SDK.