diff options
author | hjoaquim <h.joaquim@campus.fct.unl.pt> | 2022-09-12 13:46:52 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-12 14:46:52 +0200 |
commit | a73c123c3ce949b67d2fdaa7ba943b7dc469f878 (patch) | |
tree | 582cb56bf382ac0700b9f69762c2de51ff64e9a4 | |
parent | 1bdaa03cdce186e4202634e361763615ec959e1e (diff) |
ensure cmd is a well formed json string (#2523)
-rw-r--r-- | openbb_terminal/parent_classes.py | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/openbb_terminal/parent_classes.py b/openbb_terminal/parent_classes.py index b5502e49e29..8160c257283 100644 --- a/openbb_terminal/parent_classes.py +++ b/openbb_terminal/parent_classes.py @@ -10,6 +10,7 @@ import re import os import difflib import logging +import json from typing import Union, List, Dict, Any from datetime import datetime, timedelta @@ -242,13 +243,14 @@ class BaseController(metaclass=ABCMeta): self, known_cmd: str, other_args_str: str, the_input: str ) -> None: if not self.contains_keys(the_input): - logger.info( - "CMD: {'path': '%s', 'known_cmd': '%s', 'other_args': '%s', 'input': '%s'}", - self.PATH, - known_cmd, - other_args_str, - the_input, - ) + cmd = { + "path": self.PATH, + "known_cmd": known_cmd, + "other_args": other_args_str, + "input": the_input, + } + logger.info("CMD: %s", json.dumps(cmd)) + if the_input not in self.KEYS_MENU: self.log_queue() |