コード例 #1
0
ファイル: main.py プロジェクト: anikolaev82/project
    queue = Queue()
    start_time = time.time()
    logging.basicConfig(level=logging.INFO)
                        #format=u'%(filename)s[LINE:%(lineno)d]# %(levelname)-8s [%(asctime)s]  %(message)s',
                        #filename="dublicator.log")
    logging.info("Запущен {0}".format(__name__))

    conn_db = CustomSqlAlchemy()

    conn_db.start_transaction()
    logging.info(conn_db.get_list_tables())

    uTree = conn_db.mapping_exists_table(Tree, 'tree')

    pool = Pool()
    list_file = Util.recursion(p_path=param.source)
    logging.info(list_file)
    pool.map(thread, list_file)
    pool.close()
    pool.join()
    end_time = time.time()
    logging.info("the end time = {0}".format(end_time - start_time))

    logging.debug(param.action)
    if param.action == 'move':
        Util.move(conn_db)
    elif param.action == 'delete':
        Util.delete(conn_db)
    elif param.action == 'show':
        Util.show(conn_db)