log.setLevel(logging.DEBUG) if __name__ == "__main__": # parse arguments parser = argparse.ArgumentParser() parser.add_argument("in_sqlite_file", help="Input SQLite file") parser.add_argument("out_con_string", help="Connection string to empty output database. Example: sqlite:////home/john/out.db") args = parser.parse_args() print("Arguments given: ") print("Take data from: {}".format(args.in_sqlite_file)) print("Convert to : {}".format(args.out_con_string)) db = ConfigurationProvider(args.out_con_string) event_count_type = db.get_condition_type("event_count") print event_count_type from rcdb.file_archiver import get_file_sha256, get_string_sha256 con = sqlite3.connect(args.in_sqlite_file) con.row_factory = sqlite3.Row #cur = con.cursor() #cur.execute("SELECT run_num, num_events, {} FROM run_info WHERE start_time IS NOT NULL AND run_num < 2472 AND run_num > 742 ORDER BY run_num" # .format(", ".join(columns_to_import))) rcdb_cnd_not_found_count = 0 rcdb_less_count = 0 rcdb_more_count = 0 rcdb_only_runs = 0
# parse arguments parser = argparse.ArgumentParser() parser.add_argument("in_sqlite_file", help="Input SeanDB SQLite file") parser.add_argument( "out_con_string", help= "Connection string to empty output database. Example: sqlite:////home/john/out.db" ) args = parser.parse_args() print("Arguments given: ") print("Take data from: {}".format(args.in_sqlite_file)) print("Convert to : {}".format(args.out_con_string)) # open RCDB database db = ConfigurationProvider(args.out_con_string) event_count_type = db.get_condition_type("event_count") print event_count_type # open sean db sqlite con = sqlite3.connect(args.in_sqlite_file) con.row_factory = sqlite3.Row # create conditions for cnd_name, cnd_type in columns_to_import.iteritems(): db.create_condition_type(cnd_name, cnd_type, "") db.create_condition_type("seandb_event_count", ConditionType.INT_FIELD, "Event count by Sean db") total = 0 run_min = 742 run_max = 2472