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 41eb081 commit 3c03367
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 3 additions & 3 deletions scripts/workflows/demos_upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ def package_and_upload(package_in, package_out, username, password, url):
)
)
if 'hydra:description' in result:
print("%sUpload failed for %s with error: %s" % (utils.Colors.FAIL, package_out, result['hydra:description']))
print("%sUpload failed for %s with error: %s\n" % (utils.Colors.FAIL, package_out, result['hydra:description']))
else:
print("%sUpload successful for %s" % (utils.Colors.OKGREEN, package_out))
print("%sUpload successful for %s\n" % (utils.Colors.OKGREEN, package_out))
utils.raise_exception(is_status_success(result['params']))

if __name__ == "__main__":
Expand Down Expand Up @@ -100,7 +100,7 @@ def str2bool(v):
if success:
success = utils.extract_7z_file("tmp/packer.7z", "tmp")
if success:
print("%sDownload completed." % utils.Colors.OKBLUE)
print("%sDownload completed.\n\n" % utils.Colors.OKBLUE)
for demo in demos:
print("%sRunning for %s" % (utils.Colors.UNDERLINE, demo))
package_and_upload(
Expand Down
6 changes: 4 additions & 2 deletions scripts/workflows/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,14 @@ def fetch_json_from_output(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))
# TODO - return if needed for debug
# print("%s\nParsed message:\n%s\n" % (Colors.OKCYAN, line))
return json.loads(line.replace('Response: ', ''))
else:
for line in lines:
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[:line_cnt]))
# TODO - return if needed for debug
# print("%s\nParsed message:\n%s\n" % (Colors.OKCYAN, line[:line_cnt]))
return json.loads(line[:line_cnt])

0 comments on commit 3c03367

Please sign in to comment.