Skip to content

Commit

Permalink
Added hostname entry to get_decrypted_password
Browse files Browse the repository at this point in the history
  • Loading branch information
aviau committed Jan 20, 2015
1 parent b0b186b commit 98be2c3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pypass/passwordstore.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ def get_decypted_password(self, path, entry=None):
return pw.groups()[0]
else: # If there is no match, password is the first line
return decrypted_password.split('\n')[0]
elif entry == EntryType.hostname:
hostname = re.search('(?:host|hostname): (.+)', decrypted_password)
return hostname.groups()[0]
else:
return decrypted_password

Expand Down

0 comments on commit 98be2c3

Please sign in to comment.