Skip to content
This repository was archived by the owner on Mar 13, 2020. It is now read-only.

Commit 30612d3

Browse files
author
dames
committed
Added folder processing
1 parent a540cd1 commit 30612d3

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

relational_data_loader_project/DataLoadManager.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from relational_data_loader_project.DestinationTableManager import DestinationTableManager
44
from relational_data_loader_project.DataLoadTracker import DataLoadTracker
55
from relational_data_loader_project.SourceTableManager import SourceTableManager
6+
import os
67
import json
78

89

@@ -11,9 +12,13 @@ def __init__(self, configuration_path, logger=None):
1112
self.logger = logger or logging.getLogger(__name__)
1213
self.configuration_path = configuration_path
1314

14-
def start_import(self, source_engine, target_engine, configuration_name, full_load):
15+
def start_import(self, source_engine, target_engine, full_load):
16+
for file in os.listdir(self.configuration_path):
17+
self.start_single_import(source_engine, target_engine, file, full_load)
1518

16-
with open("{0}{1}.json".format(self.configuration_path, configuration_name)) as json_data:
19+
def start_single_import(self, source_engine, target_engine, configuration_name, full_load):
20+
21+
with open("{0}{1}".format(self.configuration_path, configuration_name)) as json_data:
1722
pipeline_configuration = json.load(json_data)
1823

1924
data_load_tracker = DataLoadTracker(configuration_name, json_data, full_load)

relational_data_loader_project/__main__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def main(args):
1010
destination_engine = create_engine(args['destination-engine'])
1111

1212
data_load_manager = DataLoadManager(args['configuration-folder'])
13-
data_load_manager.start_import(source_engine, destination_engine, "provider", True)
13+
data_load_manager.start_import(source_engine, destination_engine, True)
1414

1515

1616
def configure_logging():

0 commit comments

Comments
 (0)