Fill the form with pass data.

This commit is contained in:
2023-10-02 15:37:21 +02:00
parent e62e6f5c3b
commit e39d3cdb32

View File

@@ -237,6 +237,26 @@ class GTKPass(Gtk.Window):
f'There is an error:\n{data}</span>') f'There is an error:\n{data}</span>')
return return
self.label.set_label(f'<span size="x-large">{model[treeiter][4]}'
f'</span>')
output = data.split('\n')
for count, line in enumerate(output):
if count == 0:
self.password.set_text(line.strip())
continue
if (output[count].lower().startswith('user:') or
output[count].lower().startswith('username:')):
self.user.set_text(line.split(':')[1].strip())
continue
if output[count].lower().startswith('url:'):
self.url.set_text(':'.join(line.split(':')[1:]).strip())
continue
if output[count].lower().startswith('notes:'):
self.textview.get_buffer().set_text("\n".join(output[count:])
[6:].strip())
break
class Leaf: class Leaf:
"""A simple class to hold Leaf data""" """A simple class to hold Leaf data"""