Skip to content

Commit 34e5319

Browse files
authored
pykeepass: Fix docs, remove unneeded indentation (#429)
add_entry returns an Entry, not a group. Fix the docs. Also, given the `if` path only ever raises an Exception, there is no need to put the rest of the code behind an `else` conditional. Less indendation is good! Fixes #419
1 parent 2b051d9 commit 34e5319

1 file changed

Lines changed: 17 additions & 17 deletions

File tree

pykeepass/pykeepass.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,7 @@ def add_entry(self, destination_group, title, username,
673673
674674
675675
Returns:
676-
`Group`: newly added group
676+
`Entry`: newly added entry
677677
"""
678678

679679
entries = self.find_entries(
@@ -690,22 +690,22 @@ def add_entry(self, destination_group, title, username,
690690
title, destination_group
691691
)
692692
)
693-
else:
694-
logger.debug('Creating a new entry')
695-
entry = Entry(
696-
title=title,
697-
username=username,
698-
password=password,
699-
notes=notes,
700-
otp=otp,
701-
url=url,
702-
tags=tags,
703-
expires=True if expiry_time else False,
704-
expiry_time=expiry_time,
705-
icon=icon,
706-
kp=self
707-
)
708-
destination_group.append(entry)
693+
694+
logger.debug('Creating a new entry')
695+
entry = Entry(
696+
title=title,
697+
username=username,
698+
password=password,
699+
notes=notes,
700+
otp=otp,
701+
url=url,
702+
tags=tags,
703+
expires=True if expiry_time else False,
704+
expiry_time=expiry_time,
705+
icon=icon,
706+
kp=self
707+
)
708+
destination_group.append(entry)
709709

710710
return entry
711711

0 commit comments

Comments
 (0)