-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
39 lines (28 loc) · 939 Bytes
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import tui
import encryption
import functions
import os
import getpass
from prompt_toolkit import prompt
from prompt_toolkit.validation import Validator
def valiPass(text):
return len(text) > 5
validator = Validator.from_callable(
valiPass,
error_message='Please enter at least 6 characters',
move_cursor_to_end=True)
try:
os.remove("data.aes")
except:
pass
f = open(functions.HOME + "/.sendmail_mailinglist", "w")
f.write("[email protected]\n")
f.close()
print("Choose your password for this mailclient")
functions.printInRed("Warning! This password can't be changed!")
password_for_mailclient = prompt("> ", is_password=True, validator=validator)
encryption.encrypt("{}", password_for_mailclient)
tui.updateCredentials(file_password=password_for_mailclient)
functions.printInBlue("#" * 44)
functions.printInBlue("#{:^42}#".format("You can now start your mail-client!"))
functions.printInBlue("#" * 44)