Skip to content

Commit

Permalink
Print added #2
Browse files Browse the repository at this point in the history
  • Loading branch information
StrahinjaJacimovic committed Dec 5, 2024
1 parent e4bba29 commit 4c50bee
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion scripts/workflows/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,15 @@ def capture_stdout(func, *args, **kwargs):

def fetch_json_from_output(string_in):
lines = string_in.split('\n')
print("%sReturn message: %s\n" % (Colors.UNDERLINE, string_in))
print("%sReturn message:\n%s\n\n" % (Colors.UNDERLINE, string_in))
if 'HTTP error' in string_in:
for line in lines:
if 'Response' in line:
return json.loads(line.replace('Response: ', ''))
else:
print("%sEach line of message:\n" % Colors.UNDERLINE)
for line in lines:
print("%s%s" % (Colors.WARNING, line))
if 'jsonrpc' in line:
print("%s\nParsed message:\n%s\n" % (Colors.OKCYAN, line))
return json.loads(line)

0 comments on commit 4c50bee

Please sign in to comment.