email_body = kvutil.slurp(in_missingstores) if email_body: email_body += '\n\n' email_body += kvutil.slurp(in_change) + '\n\n' email_body += kvutil.slurp(in_new) + '\n\n' email_body += kvutil.slurp(in_notAvail) return email_body # --------------------------------------------------------------------------- if __name__ == '__main__': # capture the command line optiondict = kvutil.kv_parse_command_line(optiondictconfig, debug=False) # extract the values and put into variables test = optiondict['test'] AppVersion = optiondict['AppVersion'] # test that we have email populated if not optiondict['nomail'] and not optiondict['email_password']: print('must provide email_password') sys.exit(1) # load and process the files results = load_and_process_files_winetoday(debug=False) # load and process the files results = load_and_process_files_change(debug=False)
@rtype: Boolean """ if self._reEmail.search(address) is None: return False return True if __name__ == "__main__": # Run some tests import kvutil optiondict = kvutil.kv_parse_command_line( { "email_user": {}, "email_password": {}, "conf_json": { "value": "gmail-wines.json" } }, debug=False) fromaddr = optiondict['email_user'] password = optiondict['email_password'] mFrom = "Test User <*****@*****.**>" mTo = "*****@*****.**" # create the sending mail object m = GmailSend(fromaddr, password) m.addRecipient(mTo) # Simple Plain Text Email m.setSubject("Plain text email")