Commit 226f070e authored by Jacob Adams's avatar Jacob Adams

pgpcr: Add common module

For commonly used windows
parent 450526f5
from snack import *
def password():
screen = SnackScreen()
pass1 = Entry(20, password=1)
pass2 = Entry(20, password=1)
ew = EntryWindow(screen, "Password", "Enter your password", [("Password:", pass1), ("Password (again):", pass2)])
if pass1.value() != pass2.value():
error("Passwords do not match!")
return password()
elif pass1.value() == "":
error("Password cannot be empty!")
return password()
return pass1.value()
def error(msg):
screen = SnackScreen()
ButtonChoiceWindow(screen, "Error", msg, ['Ok'])
from snack import *
from . import common
def main():
screen = SnackScreen()
......@@ -16,4 +17,5 @@ def gengpgkey():
name = ew[1][0]
email = ew[1][1]
print(name, " ", email)
pw = common.password()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment