Skip to content

Commit e455a63

Browse files
added import order file variable
1 parent df722d5 commit e455a63

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

gen3schemadev/gen3datasubmitter.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ def copy_remaining_metadata(base_dir):
356356

357357
def submit_metadata(base_dir: str, project_id: str, api_endpoint: str, credentials: str, exclude_nodes: list = ["project", "program", "acknowledgement", "publication"],
358358
dry_run: bool = False, max_submission_size_kb: int = 400, retries = 5, disable_input: bool = False,
359-
specific_node: str = None, ab_path: bool = False):
359+
specific_node: str = None, ab_path: bool = False, import_order_file: str = None):
360360
"""
361361
Submits metadata json files to the gen3 api endpoint. Submission depends on a DataImportOrder.txt file, which defines the order of the nodes to be imported.
362362
@@ -371,13 +371,14 @@ def submit_metadata(base_dir: str, project_id: str, api_endpoint: str, credentia
371371
disable_input (bool): If True, disable user input confirmation. Default is False.
372372
specific_node (str): If not None, only submit the specified node.
373373
ab_path (bool): If True, use the absolute path to the base_dir.
374+
import_order_file (str): The absolute path to the import order file, if not defined the program will look for os.path.join(folder_path, project_name, "indexd", "DataImportOrder.txt")
374375
375376
Returns:
376377
None
377378
"""
378379

379380
def get_import_order(project_name, folder_path):
380-
path = os.path.join(folder_path, project_name, "indexd", "DataImportOrder.txt")
381+
path = import_order_file or os.path.join(folder_path, project_name, "indexd", "DataImportOrder.txt")
381382
try:
382383
with open(path, "r") as f:
383384
import_order = [line.rstrip() for line in f]

0 commit comments

Comments
 (0)