Skip to content

Commit de19108

Browse files
committed
update docs
1 parent 53d7b87 commit de19108

3 files changed

Lines changed: 217 additions & 39 deletions

File tree

pykeepass/attachment.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,15 @@
33

44

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

2331
@property
2432
def filename(self):
25-
"""`str`: get or set filename attachment"""
33+
"""`str`: get or set filename string"""
2634
return self._element.find('Key').text
2735

2836
@filename.setter

pykeepass/entry.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,8 @@ def attachments(self):
162162
def add_attachment(self, id, filename):
163163
"""Add attachment to entry
164164
165+
The existence of a binary with the given `id` is not checked
166+
165167
Args:
166168
id (`int`): ID of attachment in database
167169
filename (`str`): filename to assign to this attachment data
@@ -178,7 +180,7 @@ def add_attachment(self, id, filename):
178180
return attachment.Attachment(element=element, kp=self._kp)
179181

180182
def delete_attachment(self, attachment):
181-
"""remove an attachment from entry"""
183+
"""remove an attachment from entry. Does not remove binary data"""
182184
attachment.delete()
183185

184186
def deref(self, attribute):
@@ -235,7 +237,7 @@ def notes(self, value):
235237

236238
@property
237239
def icon(self):
238-
"""`str`: get or set entry icon. See icons.py"""
240+
"""`str`: get or set entry icon. See `icons`"""
239241
return self._get_subelement_text('IconID')
240242

241243
@icon.setter

0 commit comments

Comments
 (0)