
import sys
import os
sys.path.append(os.path.dirname(__file__)+"/..")
import argparse

def main(args=None):
    parser = argparse.ArgumentParser()
    parser.add_argument("--aA",dest="attachAttachment",action="store_true",help="start attachmentAttachment process")
    parser.add_argument("--etr",dest="enterpriseToRedis",action="store_true",help="start attachmentAttachment process")
    parser.add_argument("--filename",dest="filename",type=str,default=None,help="start attachmentAttachment process")
    parser.add_argument("--delkey",dest="deleteEnterpriseKey",action="store_true",help="start attachmentAttachment process")
    parser.add_argument("--keys",dest="keys",type=str,default=None,help="start attachmentAttachment process")
    parser.add_argument("--rptc",dest="remove_processed_tyc_company",action="store_true",help="start attachmentAttachment process")
    parser.add_argument("--product_dict_synchonize",dest="product_dict_synchonize",action="store_true",help="start product_dict_synchonize process")
    parser.add_argument("--delete_product_collections",dest="delete_product_collections",action="store_true",help="start product_dict_synchonize process")
    parser.add_argument("--search_similar",dest="search_similar",action="store_true",help="start product_dict_synchonize process")

    args = parser.parse_args(args)
    if args.attachAttachment:
        from BaseDataMaintenance.maintenance.document.attachAttachment import start_attachAttachment
        start_attachAttachment()
    if args.enterpriseToRedis:
        from BaseDataMaintenance.model.redis.enterprise import set_enterprise_to_redis
        if args.filename is not None:
            set_enterprise_to_redis(args.filename)
    if args.deleteEnterpriseKey:
        from BaseDataMaintenance.model.redis.enterprise import remove_enterprise_key
        if args.keys or args.filename:
            remove_enterprise_key(args.filename,args.keys)
    if args.remove_processed_tyc_company:
        from BaseDataMaintenance.maintenance.tyc_company.remove_processed import start_remove_processed_tyc_company
        start_remove_processed_tyc_company()
    if args.product_dict_synchonize:
        from BaseDataMaintenance.maintenance.product.product_dict import start_embedding_product_dict
        start_embedding_product_dict()
    if args.delete_product_collections:
        from BaseDataMaintenance.maintenance.product.product_dict import drop_product_dict_collections
        drop_product_dict_collections()
    if args.search_similar:
        from BaseDataMaintenance.maintenance.product.product_dict import search_similar
        search_similar()


if __name__ == '__main__':
    main()