Skip to content

Commit

Permalink
Added my name in contributors.md and completed Improve error handling…
Browse files Browse the repository at this point in the history
… for missing password files IMGIITRoorkee#1
  • Loading branch information
adityapro3 committed Dec 16, 2024
1 parent 075360e commit a3ef9d0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 2 additions & 0 deletions contributors.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

Aditya Sharma
11 changes: 7 additions & 4 deletions manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,13 @@ def create_password_file(self, path, initial_values=None):

def load_password_file(self, path):
self.password_file = path
with open(path, 'r') as f:
for line in f:
site, encrypted = line.split(":")
self.password_dict[site] = Fernet(self.key).decrypt(encrypted.encode()).decode()
try:
with open(path, 'r') as f:
for line in f:
site, encrypted = line.split(":")
self.password_dict[site] = Fernet(self.key).decrypt(encrypted.encode()).decode()
except:
print("Sorry, But looks like there is no file")

def add_password(self, site, password):
self.password_dict[site] = password
Expand Down

0 comments on commit a3ef9d0

Please sign in to comment.