documented the renderer section
This commit is contained in:
18
src/music_kraken/utils/debug_utils.py
Normal file
18
src/music_kraken/utils/debug_utils.py
Normal file
@@ -0,0 +1,18 @@
|
||||
from pathlib import Path
|
||||
import json
|
||||
|
||||
from .path_manager import LOCATIONS
|
||||
|
||||
|
||||
def dump_to_file(file_name: str, payload: str, is_json: bool = False, exit_after_dump: bool = True):
|
||||
path = Path(LOCATIONS.TEMP_DIRECTORY, file_name)
|
||||
print(f"Dumping payload to: \"{path}\"")
|
||||
|
||||
if is_json:
|
||||
payload = json.dumps(json.loads(payload), indent=4)
|
||||
|
||||
with path.open("w") as f:
|
||||
f.write(payload)
|
||||
|
||||
if exit_after_dump:
|
||||
exit()
|
||||
Reference in New Issue
Block a user