#!/usr/bin/python3

# # write profile files from saved data
# # only to be run once

import subprocess

from mailman import Mailman
from profile import Profile

FUFI = '/home/ernad/var/nitpo/mailman/log'
DO_VERBOSE = True

m = Mailman()
p = Profile(do_verbose=DO_VERBOSE)

events = m.read_log(FUFI, do_verbose=DO_VERBOSE)

for event in events:
    p.register(event)

#print(event)
#continue
#emad = event['emad']
#if emad != 'haotian_jiang@foxmail.com' and emad != 'jerry_academic@126.com':
#    continue
#print(event)
#continue
    #print(event)

#continue

#event = {'time': '2020-12-09T18:43:40Z', 'repcode': 'nep-ban', 'act': 'del', 'emad': 'gtastemel86@gmail.com', 'reason': 'via the member options page'}

#p.register(event)
#quit()