<commit_before><commit_msg>email updater for veeva notificiations<commit_after>#!/usr/bin/env python3
import activate_venv
import json, sys, os

from veevutils import CONFIG_FILENAME

def main():
	config = {}
	if os.path.exists(CONFIG_FILENAME):
		with open(CONFIG_FILENAME) as f:
			config = json.load(f)
	else:
		raise IOError(CONFIG_FILENAME + " does not exist")

	if len(sys.argv) < 2:
		# no email specified, prompt for one
		var email = prompt("Veeva notification email? ").strip("\r").strip("\n")
		if email = '':
			raise RuntimeError("Please specify an email address")
	else:
		email = sys.argv[1]
		
	updated = config['VEEVA']['email'] = email;

	with open(CONFIG_FILENAME) as f:
		config = f.write(json.dumps(updated))

	return 0


if __name__ == "__main__": 
	try:
		sys.exit(main())
	except KeyboardInterrupt:
		sys.exit(1)
	except Exception as e:
		print(e, file=sys.stderr)
		sys.exit(1)
{'fraction_non_alphanumeric': 0.13303769401330376, 'fraction_numerical': 0.0066518847006651885, 'mean_word_length': 4.375, 'pattern_counts': {'":': 1, '<': 4, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1823385', 'n_tokens_mistral': 347, 'n_tokens_neox': 315, 'n_words': 85}