Skip to content

Commit

Permalink
fix: flush python sdk messages
Browse files Browse the repository at this point in the history
  • Loading branch information
JoelEinbinder committed Jun 11, 2024
1 parent 52abaa4 commit 19e0a1f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion python_sdk/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "snail_sdk"
version = "0.7.5"
version = "0.11.2"
authors = [
{ name="Joel Einbinder", email="[email protected]" },
]
Expand Down
8 changes: 4 additions & 4 deletions python_sdk/snail_sdk/__init__.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import json
def display(filePath):
print('\x1b\x1aL' + str(filePath) + '\x00', end='')
print('\x1b\x1aL' + str(filePath) + '\x00', end='', flush=True)

def set_progress(progress, left_text=None, right_text=None):
print('\x1b\x1a\x4e' + json.dumps({
'progress': progress,
'leftText': left_text,
'rightText': right_text
}) + '\x00', end='')
}) + '\x00', end='', flush=True)

def chart(data):
print('\x1b\x1aC' + json.dumps(data) + '\x00', end='')
print('\x1b\x1aC' + json.dumps(data) + '\x00', end='', flush=True)

def send(data, dont_cache=False):
str = json.dumps(data)
print('\x1b\x1a' + ('Q' if dont_cache else 'M') + str + '\x00', end='')
print('\x1b\x1a' + ('Q' if dont_cache else 'M') + str + '\x00', end='', flush=True)

0 comments on commit 19e0a1f

Please sign in to comment.