Skip to content

Commit

Permalink
Merge pull request #209 from MrMenezes/fix/new_line_save_win
Browse files Browse the repository at this point in the history
Fixed bug of adding new lines when saving Sketch in Windowns
  • Loading branch information
berinhard authored Oct 20, 2022
2 parents 827b8b8 + 3a2d089 commit 3a2e757
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 2 deletions.
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

0 comments on commit 3a2e757

Please sign in to comment.