1
0
Fork 0
mirror of https://github.com/fastogt/pyfastogt synced 2025-03-09 23:38:55 +00:00

is_valid_email

This commit is contained in:
topilski 2018-01-30 11:49:59 +03:00
parent 4efd0656b8
commit 89655373d4

View file

@ -33,6 +33,13 @@ class CompileInfo(object):
self.flags_.extend(other_args) self.flags_.extend(other_args)
def is_valid_email(email: str) -> bool:
if not re.match('[^@]+@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$', email):
return False
return True
def read_file_line_by_line_to_list(file) -> list: def read_file_line_by_line_to_list(file) -> list:
if not os.path.exists(file): if not os.path.exists(file):
raise BuildError('file path: {0} not exists'.format(file)) raise BuildError('file path: {0} not exists'.format(file))