32 lines
673 B
Python
32 lines
673 B
Python
|
import getopt
|
||
|
import sys
|
||
|
import yaml
|
||
|
|
||
|
from data_processor import DataProcessor
|
||
|
|
||
|
config_name = 'config.yml'
|
||
|
|
||
|
options = "hc:"
|
||
|
long_options = ["help", "config="]
|
||
|
|
||
|
argumentList = sys.argv[1:]
|
||
|
arguments, values = getopt.getopt(argumentList, options, long_options)
|
||
|
|
||
|
for currentArgument, currentValue in arguments:
|
||
|
|
||
|
if currentArgument in ("-h", "--help"):
|
||
|
print("reader.py [--config=path/to/config.yml]")
|
||
|
|
||
|
sys.exit(0)
|
||
|
|
||
|
elif currentArgument in ("-c", "--config"):
|
||
|
config_name = currentValue
|
||
|
|
||
|
with open(config_name) as f:
|
||
|
config = yaml.load(f, Loader=yaml.FullLoader)
|
||
|
|
||
|
print("config: ", config)
|
||
|
|
||
|
processor = DataProcessor(config)
|
||
|
processor.run()
|