示例#1
0
文件: commands.py 项目: citymap/mmf
def db2blob(year, month, day, root_dir):
    db_file = '/tmp/{:04d}-{:02d}-{:02d}.db'.format(year, month, day)

    db = LogDb()
    db.connect()
    db.create_cursor()

    db.import_db(db_file)

    date = '{:04d}-{:02d}-{:02d}'.format(year, month, day)

    start_time = int(time_sec(date + 'T00:00:00.00'))
    end_time = start_time + 24 * 60 * 60

    PriceBoardDB.export_board_to_blob(db_object=db, start_time=start_time, end_time=end_time, root_dir=root_dir)

    db.close()
示例#2
0
 def test_load_tf_records(self):
     PriceBoardDB.export_board_to_blob()
示例#3
0
 def test_save_to_tf_record(self):
     PriceBoardDB.export_board_to_blob()
示例#4
0
        if len(sys.argv) == 3:
            export_dir = sys.argv[2]

    skip = False

    for db_file in db_files:
        print(db_file, export_dir)

        db = LogDb(db_file)
        db.connect()
        db.create_cursor()

        db.update_all_order_prices(False)
        db.update_all_best_action(False)

        if skip:
            skip_number = db.skip_nop_close_to_action()
            print('skip rec->', skip_number)

        db.close()

        db = LogDb()
        db.connect()
        db.create_cursor()

        db.import_db(db_file)

        PriceBoardDB.export_board_to_blob(db_object=db, root_dir=export_dir)

        db.close()