Update README. Make sure to always have unique Titles for entries.

This commit is contained in:
Markus Birth 2021-08-22 17:06:38 +02:00
parent 9439e42cdb
commit 6b3c2a157c
Signed by: mbirth
GPG Key ID: A9928D7A098C3A9A
2 changed files with 9 additions and 3 deletions

View File

@ -32,13 +32,13 @@ Basic 1Password 1PIF structure
'fields': [
{
'designation': 'username',
'name': 'username',
'name': 'name_of_username_field_on_website',
'type': 'T',
'value': 'john.doe'
},
{
'designation': 'password',
'name': 'password',
'name': 'name_of_password_field_on_website',
'type': 'P',
'value': 'ultrasecurepassword'
}

View File

@ -16,7 +16,13 @@ class KpWriter:
# TODO: Handle nested groups?
group = self.kp.add_group(self.kp.root_group, dest_group_name)
self.current_entry = self.kp.add_entry(group, title, "", "")
suffix_ctr = 1
new_title = title
while self.kp.find_entries(title=new_title, group=group):
suffix_ctr += 1
new_title = "{} - {}".format(title, suffix_ctr)
self.current_entry = self.kp.add_entry(group, new_title, "", "")
return self.current_entry
def save(self):