Skip to content
This repository was archived by the owner on Oct 6, 2023. It is now read-only.

Commit 7080858

Browse files
author
Tim Sowers
committed
Update DOE CODE parameters to work with config file.
1 parent 94d3c2c commit 7080858

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

Diff for: scraper/code_gov/__init__.py

-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ def process_config(config):
121121
code_gov_metadata["releases"].append(code_gov_project)
122122

123123
# Handle parsing of DOE CODE records
124-
125124
doecode_config = config.get("DOE CODE", {})
126125
doecode_json = doecode_config.get("json", None)
127126
doecode_url = doecode_config.get("url", None)

Diff for: scraper/gen_code_gov_json.py

+8-4
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,14 @@ def main():
123123
if args.github_gov_orgs:
124124
config_json["github_gov_orgs"] = True
125125

126-
config_json["DOE CODE"] = {}
127-
config_json["DOE CODE"]["json"] = args.doecode_json
128-
config_json["DOE CODE"]["url"] = args.doecode_url
129-
config_json["DOE CODE"]["api_key"] = args.doecode_api_key
126+
# Handle DOE CODE overrides
127+
doecode_config = config_json.get("DOE CODE", {})
128+
if args.doecode_json:
129+
doecode_config["json"] = args.doecode_json
130+
if args.doecode_url:
131+
doecode_config["url"] = args.doecode_url
132+
if args.doecode_api_key:
133+
doecode_config["api_key"] = args.doecode_api_key
130134

131135
output_path = config_json.get("output_path", None)
132136
output_path = args.output_path or output_path

0 commit comments

Comments
 (0)