logging.warning(f'"{email.strip()}": is not a valid email -> not added in a group')
returnis_valid
if__name__=='__main__':
parser=argparse.ArgumentParser(description='Repos file generator - create the PWM repos file from a list of emails')
parser.add_argument('in_file',type=argparse.FileType('r'),default='-',help='name of the file containing a list of email adresses (- for stdin)')
parser.add_argument('repos_file',type=argparse.FileType('w'),default='repos_file.yml',help='name of the repos file')
# In the case we want to implement input file parsers:
# parser.add_argument('-f', '--field', help='name of the field containing emails if the input as several fields (e.g. CSV)')
args=parser.parse_args()
email_list=[line.strip()forlineinargs.in_fileifis_valid_email(line.strip())]# I do not get why I need to strip for validating email -> the regexp should take care of line return with $