Skip to content

Commit fa7040d

Browse files
author
gau1991
committed
EMail validation on setup.py
1 parent e012a16 commit fa7040d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

setup.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import os
55
import glob
66
import configparser
7+
import re
78

89
conf = []
910
templates = []
@@ -39,6 +40,12 @@
3940

4041
ee_user = input("Enter your name: ")
4142
ee_email = input("Enter your email: ")
43+
44+
while not re.match(r"^[A-Za-z0-9\.\+_-]+@[A-Za-z0-9\._-]+\.[a-zA-Z]*$",
45+
ee_email):
46+
print("EMail not Valid, Please enter again")
47+
ee_email = input("Enter your email: ")
48+
4249
os.system("git config --global user.name {0}".format(ee_user))
4350
os.system("git config --global user.email {0}".format(ee_email))
4451

0 commit comments

Comments
 (0)