-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'release/0.7.2' into main
- Loading branch information
Showing
142 changed files
with
1,168 additions
and
336 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
0.7.1 | ||
0.7.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
|
||
EXIT_CODE=0 | ||
|
||
while IFS= read -r -d '' file; do | ||
if ! head -5 "$file" | grep -q 'Copyright'; then | ||
echo "$file" is missing a license | ||
EXIT_CODE=1 | ||
fi | ||
done < <(find pyp5js -type f \( \ | ||
-name "*.py" -o \ | ||
-name "*.html" -o \ | ||
-name "*.js.template" \) -print0) | ||
|
||
exit $EXIT_CODE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
-r requirements.txt | ||
|
||
black==19.3b0 | ||
ipython==7.8.0 | ||
pytest==4.5.0 | ||
tox==3.10.0 | ||
black==22.10.0 | ||
ipython==7.34.0 | ||
pytest==7.1.3 | ||
tox==3.26.0 | ||
pytest-env==0.6.2 | ||
Flask-Testing==0.8.0 | ||
blinker==1.4 | ||
pyaml==20.4.0 | ||
wheel==0.37.0 | ||
twine==3.4.2 | ||
Flask-Testing==0.8.1 | ||
blinker==1.5 | ||
pyaml==21.10.1 | ||
wheel==0.37.1 | ||
twine==4.0.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
const initialSketch = checkForSketch(); | ||
|
||
//// Configure ACE editor | ||
const editor = ace.edit("text-editor"); | ||
editor.session.setMode("ace/mode/python"); | ||
editor.setFontSize(18); | ||
editor.session.setOptions({ | ||
tabSize: 4, | ||
}); | ||
editor.setValue(initialSketch); | ||
|
||
//// Update div's content with most up to date code | ||
editor.session.on("change", function () { | ||
document.getElementById("id_py_code").innerHTML = editor | ||
.getSession() | ||
.getValue(); | ||
}); | ||
document.getElementById("id_py_code").innerHTML = initialSketch; | ||
|
||
document.addEventListener("DOMContentLoaded", function () { | ||
//// Buttons | ||
const shareBtn = document.getElementById("shareBtn"); | ||
const collapseBtn = document.getElementById("collapseBtn"); | ||
const executeBtn = document.getElementById("executeBtn"); | ||
const clearBtn = document.getElementById("clearBtn"); | ||
|
||
//// Event functions | ||
function runCode() { | ||
document.getElementById("sketch-holder").innerHTML = ""; | ||
const userCode = editor.getSession().getValue(); | ||
|
||
// from pyp5js | ||
window.runSketchCode(userCode); | ||
} | ||
|
||
function cleanKeyCode(e) { | ||
// Shortcuts work for Ctrl or Cmd | ||
if (e.ctrlKey || e.metaKey) { | ||
return e.keyCode; | ||
} | ||
} | ||
|
||
function keyDown(e) { | ||
if (cleanKeyCode(e) === 13) { | ||
// Ctrl + Enter to run | ||
e.preventDefault(); | ||
executeBtn.click(); | ||
} else if (cleanKeyCode(e) === 190) { | ||
// Ctrl + . to clear | ||
e.preventDefault(); | ||
clearBtn.click(); | ||
} | ||
} | ||
|
||
executeBtn.addEventListener("click", () => { | ||
if (window.instance) { | ||
runCode(); | ||
} else { | ||
window.alert( | ||
"Pyodide is still loading.\nPlease, wait a few seconds and try to run it again." | ||
); | ||
} | ||
}); | ||
clearBtn.addEventListener("click", () => { | ||
if (window.instance) { | ||
document.getElementById("sketch-holder").innerHTML = ""; | ||
window.instance.remove(); | ||
} | ||
}); | ||
shareBtn.addEventListener("click", () => { | ||
if (window.instance) { | ||
const sketchUrl = createSketchUrl(); | ||
copyTextToClipboard(sketchUrl); | ||
shareBtn.textContent = "Copied URL!"; | ||
setTimeout(() => { | ||
shareBtn.textContent = "Share"; | ||
}, 3000); | ||
runCode(); | ||
} | ||
}); | ||
collapseBtn.addEventListener("click", () => { | ||
const textEditorEl = document.getElementById("text-editor"); | ||
textEditorEl.classList.toggle("hidden-editor"); | ||
collapseBtn.textContent = collapseBtn.textContent.includes("Collapse") | ||
? "Expand" | ||
: "Collapse"; | ||
}); | ||
document.body.addEventListener("keydown", keyDown); | ||
}); |
Oops, something went wrong.