From 440e9df633c2cb4ff401d6683a6129ba1ae42928 Mon Sep 17 00:00:00 2001 From: rune Date: Thu, 13 Apr 2023 09:29:07 +0200 Subject: [PATCH] WIP --- malias.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/malias.py b/malias.py index 627e9e7..4dcf6ae 100644 --- a/malias.py +++ b/malias.py @@ -48,8 +48,9 @@ def connect_database(): api text NOT NULL)''') c.execute('''CREATE TABLE IF NOT EXISTS settings ( id INTEGER NOT NULL PRIMARY KEY, - first_run INTEGER DEFAULT 0, - server TEXT DEFAULT "TEST" + first_run INTEGER, + server TEXT, + data_copy INTEGER" )''') c.execute('''CREATE TABLE IF NOT EXISTS aliases (id integer NOT NULL PRIMARY KEY, @@ -151,6 +152,12 @@ def delete(alias): print('Delete : ' + alias) + + +def copy_data(): + print('copy') + + def checklist(alias): apikey = get_api() mail_server = get_settings('mail_server') @@ -267,6 +274,9 @@ parser.add_argument('-a', '--add', help='Add new alias.\n\n', parser.add_argument('-v', '--version', help='Show current version and config info\n\n', required=False, action='store_true') +parser.add_argument('-c', '--copy', help='Copy alias data from MailCow server to local DB.\n\n', + required=False, action='store_true') + args = vars(parser.parse_args()) if args['api']: @@ -279,6 +289,8 @@ elif args['add']: create(args['add'][0][0],args['add'][0][1]) elif args['version']: show_current_info() +elif args['version']: + copy_data() else: