Skip to content

Commit 68ba826

Browse files
committed
Move "en-/decrypt_all_passwords" to "pw_client.py"
1 parent a8b85e9 commit 68ba826

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

src/pw_client.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,3 +179,10 @@ def manipulate_passwords(self, crypto: Callable = None) -> None:
179179
manipulated_password = crypto(current_password)
180180
v["password"] = manipulated_password
181181
self.save_dict_to_file()
182+
183+
def encrypt_all_passwords(self):
184+
self.create_backup()
185+
self.manipulate_passwords(self.crypto.encrypt)
186+
187+
def decrypt_all_passwords(self):
188+
self.manipulate_passwords(self.crypto.decrypt)

src/pw_command.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -101,17 +101,6 @@ def main(parsed_args):
101101
return pw.get_pw(args.input)
102102

103103

104-
def encrypt_all_passwords():
105-
pw = pw_client.PasswordClient(CREDS_DIR, CREDS_FILE_PATH)
106-
pw.create_backup()
107-
pw.manipulate_passwords(pw.crypto.encrypt)
108-
109-
110-
def decrypt_all_passwords():
111-
pw = pw_client.PasswordClient(CREDS_DIR, CREDS_FILE_PATH)
112-
pw.manipulate_passwords(pw.crypto.decrypt)
113-
114-
115104
if __name__ == '__main__':
116105
args = parse_args()
117106
main(args)

0 commit comments

Comments
 (0)