-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
27 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
from pathlib import Path | ||
|
||
from dynaconf import Dynaconf | ||
|
||
settings = Dynaconf( | ||
envvar_prefix="METRICS", settings_files=["settings.yaml", ".secrets.yaml"], | ||
) | ||
|
||
METRICS_DIR = Path() | ||
METRICS_OUTPUT = METRICS_DIR.joinpath("metrics_output") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
# module to handle file IO functions, to keep them out of the click command module | ||
import json | ||
from config import METRICS_OUTPUT | ||
|
||
|
||
def write_to_output(output_filename, content): | ||
with open(output_filename, "w") as output_file: | ||
json.dump(content, output_file, indent=2) | ||
"""output_filename should be a pathlib Path object""" | ||
METRICS_OUTPUT.mkdir(parents=True, exist_ok=True) | ||
output_filename.write_text(content) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters