Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed bug of adding new lines when saving Sketch in Windowns #209

Merged
merged 6 commits into from
Oct 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ Development
-----------
- Remove existing sketch after clearing/running it again [PR #199](https://github.com/berinhard/pyp5js/pull/199)
- Add share button to demo editor [PR #205](https://github.com/berinhard/pyp5js/pull/205)
- Fixed bug of adding new lines when saving Sketch in Windowns [PR #209](https://github.com/berinhard/pyp5js/pull/209)

0.7.1
-----
Expand Down
33 changes: 33 additions & 0 deletions Makefile.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
@echo off

IF /I "%1"=="test" GOTO test
IF /I "%1"=="update_dist" GOTO update_dist
IF /I "%1"=="upload_pypi" GOTO upload_pypi
IF /I "%1"=="run_demo" GOTO run_demo
GOTO error

:test
set PYTHONWARNINGS=ignore::flask.DeprecationWarning && pytest
GOTO :EOF

:update_dist
@python3 setup.py sdist bdist_wheel
GOTO :EOF

:upload_pypi
@twine upload dist/*
GOTO :EOF

:run_demo
PUSHD docs/pyodide
python -m http.server
POPD
GOTO :EOF

:error
IF "%1"=="" (
ECHO make: *** No targets specified and no makefile found. Stop.
) ELSE (
ECHO make: *** No rule to make target '%1%'. Stop.
)
GOTO :EOF
2 changes: 1 addition & 1 deletion pyp5js/http/web_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def render_sketch_view(sketch_name, static_path):
else:
try:
ast.parse(py_code, sketch.sketch_py.name)
sketch.sketch_py.write_text(py_code)
sketch.sketch_py.write_bytes(bytes(py_code, encoding="utf-8"))
except SyntaxError as exc:
error = f'SyntaxError: {exc}'

Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ cprint==1.1
gunicorn==19.9.0
watchdog==0.9.0
python-decouple==3.1
Flask==1.1.2
Flask==1.1.4
python-slugify==3.0.4
markupsafe==2.0.1