Skip to content

Commit

Permalink
Restored python version
Browse files Browse the repository at this point in the history
  • Loading branch information
StrahinjaJacimovic committed Dec 5, 2024
1 parent dd5bd91 commit 41eb081
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/demos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Set up python
uses: actions/setup-python@v5
with:
python-version: '3.12'
python-version: '3.x'

- name: Install dependencies
run: |
Expand Down
10 changes: 5 additions & 5 deletions scripts/workflows/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,15 +140,15 @@ def capture_stdout(func, *args, **kwargs):

def fetch_json_from_output(string_in):
lines = string_in.split('\n')
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:
print("%s\nParsed message:\n%s\n" % (Colors.OKCYAN, 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 'Content-Length: ' in line:
line_cnt = int(line.replace('Content-Length: ', ''))
if 'jsonrpc' in line:
print("%s\nParsed message:\n%s\n" % (Colors.OKCYAN, line))
return json.loads(line)
print("%s\nParsed message:\n%s\n" % (Colors.OKCYAN, line[:line_cnt]))
return json.loads(line[:line_cnt])

0 comments on commit 41eb081

Please sign in to comment.