Skip to content

Conversation

@ukumar-ks
Copy link
Contributor

Implemented "keeper-fill" command with it sub-command "list" and "set" for python SDK.


@staticmethod
def _format_url_for_display(url, verbose: bool) -> str:
"""Format URL(s) for display, optionally truncating."""
Copy link

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)
Copy link

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)
Copy link

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]:
"""
Copy link

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)
Copy link

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))
Copy link

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)
Copy link

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]:
Copy link

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]:
"""
Copy link

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]:

Copy link
Contributor

@adeshmukh-ks adeshmukh-ks left a 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants