Skip to content

Commit

Permalink
Merge branch 'main' into ufal/py-collection2item-table-is-not-migrated
Browse files Browse the repository at this point in the history
  • Loading branch information
milanmajchrak authored Sep 26, 2023
2 parents fd5de12 + 306f4f6 commit d31f6b6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion data_pump/item.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
def import_item(metadata_class,
handle_class,
workflowitem_id_dict,
workspaceitem_id_dict,
item_id_dict,
collection_id_dict,
eperson_id_dict,
Expand All @@ -32,7 +33,6 @@ def import_item(metadata_class,
imported_workspaceitem = 0
imported_workflowitem = 0
imported_item = 0
workspaceitem_id_dict = {}
# create dict from items by item id
item_json_list = read_json(item_json_name)
items_dict = {}
Expand Down
1 change: 1 addition & 0 deletions data_pump/var_declarations.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
collection2logo_dict = {}
item_id_dict = {}
workflowitem_id_dict = {}
workspaceitem_id_dict = {}
bitstreamformat_id_dict = {}
primaryBitstream_dict = {}
bitstream2bundle_dict = {}
Expand Down
11 changes: 6 additions & 5 deletions main.data_pump.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ def at_the_end_of_import(handle_class_p, statistics_dict):
" expected and imported " + str(value[1]))


def insert_data_into_dicts(eperson_json_name, user_registraion_json_name,
def load_data_into_dicts(eperson_json_name, user_registraion_json_name,
group_json_name, community_json_name, collection_json_name,
item_json_name, workspace_json_name, workflow_json_name,
item_json_name, workspaceitem_json_name, workflow_json_name,
bitstreamformat_json_name, bundle_json_name,
bitstream_json_name, insert_data):
if not insert_data:
Expand All @@ -50,7 +50,7 @@ def insert_data_into_dicts(eperson_json_name, user_registraion_json_name,
var.community_id_dict = create_dict_from_json(community_json_name)
var.collection_id_dict = create_dict_from_json(collection_json_name)
var.item_id_dict = create_dict_from_json(item_json_name)
var.workflowitem_id_dict = create_dict_from_json(workspace_json_name)
var.workspaceitem_id_dict = create_dict_from_json(workspaceitem_json_name)
var.workflowitem_id_dict = create_dict_from_json(workflow_json_name)
var.bitstreamformat_id_dict = create_dict_from_json(bitstreamformat_json_name)
var.bundle_id_dict = create_dict_from_json(bundle_json_name)
Expand All @@ -76,14 +76,14 @@ def insert_data_into_dicts(eperson_json_name, user_registraion_json_name,
if email_s_off not in ("y", "yes"):
sys.exit()

insert_data_into_dicts("eperson_dict.json",
load_data_into_dicts("eperson_dict.json",
"user_registration_dict.json",
"epersongroup_dict.json",
"community_dict.json",
"collection_dict.json",
"item_dict.json",
"workflowitem_dict.json",
"workspaceitem_dict.json",
"workflowitem_dict.json",
"bitstreamformatregistry_dict.json",
"bundle_dict.json",
"bitstream_dict.json",
Expand Down Expand Up @@ -130,6 +130,7 @@ def insert_data_into_dicts(eperson_json_name, user_registraion_json_name,
import_item(metadata_class,
handle_class,
var.workflowitem_id_dict,
var.workspaceitem_id_dict,
var.item_id_dict,
var.collection_id_dict,
var.eperson_id_dict,
Expand Down

0 comments on commit d31f6b6

Please sign in to comment.