Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Evidlo committed Dec 3, 2024
1 parent 53d7b87 commit de19108
Show file tree
Hide file tree
Showing 3 changed files with 217 additions and 39 deletions.
12 changes: 10 additions & 2 deletions pykeepass/attachment.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,15 @@


class Attachment:
"""Binary data attached to an `Entry`. A piece of binary data may be attached to multiple entries"""
"""Binary data attached to an `Entry`.
*Binary* refers to the bytes of the attached data
(stored at the root level of the database), while *attachment* is a
reference to a binary (stored in an entry). A binary can be referenced
by none, one or many attachments.
A piece of binary data may be attached to multiple entries
"""
def __init__(self, element=None, kp=None, id=None, filename=None):
self._element = element
self._kp = kp
Expand All @@ -22,7 +30,7 @@ def id(self, id):

@property
def filename(self):
"""`str`: get or set filename attachment"""
"""`str`: get or set filename string"""
return self._element.find('Key').text

@filename.setter
Expand Down
6 changes: 4 additions & 2 deletions pykeepass/entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@ def attachments(self):
def add_attachment(self, id, filename):
"""Add attachment to entry
The existence of a binary with the given `id` is not checked
Args:
id (`int`): ID of attachment in database
filename (`str`): filename to assign to this attachment data
Expand All @@ -178,7 +180,7 @@ def add_attachment(self, id, filename):
return attachment.Attachment(element=element, kp=self._kp)

def delete_attachment(self, attachment):
"""remove an attachment from entry"""
"""remove an attachment from entry. Does not remove binary data"""
attachment.delete()

def deref(self, attribute):
Expand Down Expand Up @@ -235,7 +237,7 @@ def notes(self, value):

@property
def icon(self):
"""`str`: get or set entry icon. See icons.py"""
"""`str`: get or set entry icon. See `icons`"""
return self._get_subelement_text('IconID')

@icon.setter
Expand Down
Loading

0 comments on commit de19108

Please sign in to comment.