#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2020 fx-kirin <fx.kirin@gmail.com>
#
# Distributed under terms of the MIT license.

"""

"""

import os
import fire
import logging
import kanilog
import stdlogging
from pathlib import Path

from csv_zip_rsync import upload_and_remove_zip, make_zip_from_csv


def main(root_dir, not_modified_period=86400, suffix="csv"):
    kanilog.setup_logger(
        logfile="/tmp/%s.log" % (Path(__file__).name), level=logging.INFO
    )
    stdlogging.enable()
    make_zip_from_csv(root_dir, not_modified_period, suffix)


if __name__ == "__main__":
    fire.Fire(main)
