From fa7040d77a7f5479695cec9791869bfaee2a3db2 Mon Sep 17 00:00:00 2001 From: gau1991 Date: Thu, 5 Feb 2015 19:30:16 +0530 Subject: [PATCH] EMail validation on setup.py --- setup.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/setup.py b/setup.py index 87d6a385..88863ee6 100644 --- a/setup.py +++ b/setup.py @@ -4,6 +4,7 @@ import sys import os import glob import configparser +import re conf = [] templates = [] @@ -39,6 +40,12 @@ except Exception as e: ee_user = input("Enter your name: ") ee_email = input("Enter your email: ") + + while not re.match(r"^[A-Za-z0-9\.\+_-]+@[A-Za-z0-9\._-]+\.[a-zA-Z]*$", + ee_email): + print("EMail not Valid, Please enter again") + ee_email = input("Enter your email: ") + os.system("git config --global user.name {0}".format(ee_user)) os.system("git config --global user.email {0}".format(ee_email))