Skip to content
Snippets Groups Projects
Commit 3a64a9f4 authored by Rodrigo Cortes Mejia's avatar Rodrigo Cortes Mejia
Browse files

Replaced fw_config method w/ default lpad location

parent 689fca97
No related branches found
No related tags found
1 merge request!3Resolve "lpad_query command not working without -l option"
......@@ -2,7 +2,7 @@
import json, yaml
from argparse import ArgumentParser
from fireworks.scripts.lpad_run import get_lp
from fireworks.fw_config import CONFIG_FILE_DIR
from fireworks.fw_config import LAUNCHPAD_LOC
from dbquery import db_select
def query():
......@@ -13,9 +13,9 @@ def query():
help='Set output format: json or yaml.')
parser.add_argument('-c', '--config_dir',
help='path to configuration file (if -l unspecified)',
default=CONFIG_FILE_DIR)
default=LAUNCHPAD_LOC)
parser.add_argument('-l', '--launchpad_file',
help='path to launchpad file', default=None)
help='path to launchpad file', default=LAUNCHPAD_LOC)
parser.add_argument('-f', '--query_file', required=True,
help='path to query file')
args = parser.parse_args()
......@@ -27,7 +27,7 @@ def query():
fmt = args.query_file.split('.')[-1]
assert fmt in ['json', 'yaml']
with open(args.query_file, 'r') as inp:
with open(args.query_file, 'r', encoding='utf-8') as inp:
query_dict = json.load(inp) if fmt == 'json' else yaml.safe_load(inp)
print(dumpf(db_select(get_lp(args), **query_dict), **dumpkw[args.output]))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment