Repository: berinhard/pyp5js
Branch: develop
Commit: 87ebb8e48eba
Files: 369
Total size: 43.5 MB
Directory structure:
gitextract_1xzdirb8/
├── .github/
│ └── workflows/
│ └── ci.yml
├── .gitignore
├── .gitpod.yml
├── CHANGELOG.md
├── CONTRIBUTING.md
├── LICENSE
├── MANIFEST.in
├── Makefile
├── Makefile.bat
├── README.md
├── VERSION
├── bin/
│ └── check_license.sh
├── dev-requirements.txt
├── docs/
│ ├── examples/
│ │ ├── index.md
│ │ ├── pyodide/
│ │ │ ├── bouncing/
│ │ │ │ ├── bouncing.py
│ │ │ │ ├── bouncingFPS.py
│ │ │ │ ├── index.html
│ │ │ │ ├── odkaz.txt
│ │ │ │ ├── static/
│ │ │ │ │ └── p5.js
│ │ │ │ └── target/
│ │ │ │ └── target_sketch.js
│ │ │ ├── breakout/
│ │ │ │ ├── breakout-kb.py
│ │ │ │ ├── breakout-ms.py
│ │ │ │ ├── breakout.py
│ │ │ │ ├── index.html
│ │ │ │ ├── static/
│ │ │ │ │ └── p5.js
│ │ │ │ └── target/
│ │ │ │ └── target_sketch.js
│ │ │ ├── flappybird/
│ │ │ │ ├── flappybird.py
│ │ │ │ ├── index.html
│ │ │ │ ├── static/
│ │ │ │ │ └── p5.js
│ │ │ │ └── target/
│ │ │ │ └── target_sketch.js
│ │ │ ├── index.html.template
│ │ │ ├── memory/
│ │ │ │ ├── LICENCE
│ │ │ │ ├── README.md
│ │ │ │ ├── index.html
│ │ │ │ ├── memory.py
│ │ │ │ ├── static/
│ │ │ │ │ └── p5.js
│ │ │ │ └── target/
│ │ │ │ └── target_sketch.js
│ │ │ ├── mines/
│ │ │ │ ├── index.html
│ │ │ │ ├── mines.py
│ │ │ │ ├── static/
│ │ │ │ │ └── p5.js
│ │ │ │ └── target/
│ │ │ │ └── target_sketch.js
│ │ │ ├── pong/
│ │ │ │ ├── index.html
│ │ │ │ ├── pong.py
│ │ │ │ ├── static/
│ │ │ │ │ └── p5.js
│ │ │ │ └── target/
│ │ │ │ └── target_sketch.js
│ │ │ ├── samegame/
│ │ │ │ ├── index.html
│ │ │ │ ├── samegame.py
│ │ │ │ ├── static/
│ │ │ │ │ └── p5.js
│ │ │ │ └── target/
│ │ │ │ └── target_sketch.js
│ │ │ ├── sketch_001/
│ │ │ │ ├── index.html
│ │ │ │ ├── sketch_001.py
│ │ │ │ ├── static/
│ │ │ │ │ └── p5.js
│ │ │ │ └── target/
│ │ │ │ └── target_sketch.js
│ │ │ ├── sketch_002/
│ │ │ │ ├── index.html
│ │ │ │ ├── sketch_002.py
│ │ │ │ ├── static/
│ │ │ │ │ └── p5.js
│ │ │ │ └── target/
│ │ │ │ └── target_sketch.js
│ │ │ ├── sketch_003/
│ │ │ │ ├── index.html
│ │ │ │ ├── sketch_003.py
│ │ │ │ ├── static/
│ │ │ │ │ └── p5.js
│ │ │ │ └── target/
│ │ │ │ └── target_sketch.js
│ │ │ ├── sketch_004/
│ │ │ │ ├── index.html
│ │ │ │ ├── sketch_004.py
│ │ │ │ ├── static/
│ │ │ │ │ └── p5.js
│ │ │ │ └── target/
│ │ │ │ └── target_sketch.js
│ │ │ ├── sketch_005/
│ │ │ │ ├── index.html
│ │ │ │ ├── sketch_005.py
│ │ │ │ ├── static/
│ │ │ │ │ └── p5.js
│ │ │ │ └── target/
│ │ │ │ └── target_sketch.js
│ │ │ ├── sketch_006/
│ │ │ │ ├── index.html
│ │ │ │ ├── sketch_006.py
│ │ │ │ ├── static/
│ │ │ │ │ └── p5.js
│ │ │ │ └── target/
│ │ │ │ └── target_sketch.js
│ │ │ ├── sketch_007/
│ │ │ │ ├── index.html
│ │ │ │ ├── sketch_007.py
│ │ │ │ ├── static/
│ │ │ │ │ └── p5.js
│ │ │ │ └── target/
│ │ │ │ └── target_sketch.js
│ │ │ ├── sketch_008/
│ │ │ │ ├── index.html
│ │ │ │ ├── sketch_008.py
│ │ │ │ ├── static/
│ │ │ │ │ └── p5.js
│ │ │ │ └── target/
│ │ │ │ └── target_sketch.js
│ │ │ ├── sketch_009/
│ │ │ │ ├── index.html
│ │ │ │ ├── sketch_009.py
│ │ │ │ ├── static/
│ │ │ │ │ └── p5.js
│ │ │ │ └── target/
│ │ │ │ └── target_sketch.js
│ │ │ ├── sketch_010/
│ │ │ │ ├── index.html
│ │ │ │ ├── sketch_010.py
│ │ │ │ ├── static/
│ │ │ │ │ └── p5.js
│ │ │ │ └── target/
│ │ │ │ └── target_sketch.js
│ │ │ ├── sketch_011/
│ │ │ │ ├── index.html
│ │ │ │ ├── sketch_011.py
│ │ │ │ ├── static/
│ │ │ │ │ └── p5.js
│ │ │ │ └── target/
│ │ │ │ └── target_sketch.js
│ │ │ └── sketch_012/
│ │ │ ├── index.html
│ │ │ ├── sketch_012.py
│ │ │ ├── static/
│ │ │ │ └── p5.js
│ │ │ └── target/
│ │ │ └── target_sketch.js
│ │ ├── sketch_000/
│ │ │ ├── index.html
│ │ │ ├── sketch_000.py
│ │ │ ├── static/
│ │ │ │ └── p5.js
│ │ │ └── target/
│ │ │ ├── org.transcrypt.__runtime__.js
│ │ │ ├── org.transcrypt.__runtime__.py
│ │ │ ├── pyp5js.js
│ │ │ ├── pyp5js.py
│ │ │ ├── pyp5js.python_functions.js
│ │ │ ├── pyp5js.python_functions.py
│ │ │ ├── sketch_000.js
│ │ │ ├── sketch_000.py
│ │ │ ├── target_sketch.js
│ │ │ ├── target_sketch.project
│ │ │ └── target_sketch.py
│ │ └── transcrypt/
│ │ ├── index.html.template
│ │ ├── sketch_001/
│ │ │ ├── index.html
│ │ │ ├── sketch_001.py
│ │ │ ├── static/
│ │ │ │ └── p5.js
│ │ │ └── target/
│ │ │ ├── org.transcrypt.__runtime__.js
│ │ │ ├── org.transcrypt.__runtime__.py
│ │ │ ├── pyp5js.js
│ │ │ ├── pyp5js.py
│ │ │ ├── python_functions.js
│ │ │ ├── python_functions.py
│ │ │ ├── target_sketch.js
│ │ │ ├── target_sketch.project
│ │ │ └── target_sketch.py
│ │ ├── sketch_002/
│ │ │ ├── index.html
│ │ │ ├── sketch_002.py
│ │ │ ├── static/
│ │ │ │ └── p5.js
│ │ │ └── target/
│ │ │ ├── org.transcrypt.__runtime__.js
│ │ │ ├── org.transcrypt.__runtime__.py
│ │ │ ├── pyp5js.js
│ │ │ ├── pyp5js.py
│ │ │ ├── python_functions.js
│ │ │ ├── python_functions.py
│ │ │ ├── target_sketch.js
│ │ │ ├── target_sketch.project
│ │ │ └── target_sketch.py
│ │ ├── sketch_003/
│ │ │ ├── index.html
│ │ │ ├── sketch_003.py
│ │ │ ├── static/
│ │ │ │ └── p5.js
│ │ │ └── target/
│ │ │ ├── org.transcrypt.__runtime__.js
│ │ │ ├── org.transcrypt.__runtime__.py
│ │ │ ├── pyp5js.js
│ │ │ ├── pyp5js.py
│ │ │ ├── python_functions.js
│ │ │ ├── python_functions.py
│ │ │ ├── target_sketch.js
│ │ │ ├── target_sketch.project
│ │ │ └── target_sketch.py
│ │ ├── sketch_004/
│ │ │ ├── index.html
│ │ │ ├── sketch_004.py
│ │ │ ├── static/
│ │ │ │ └── p5.js
│ │ │ └── target/
│ │ │ ├── org.transcrypt.__runtime__.js
│ │ │ ├── org.transcrypt.__runtime__.py
│ │ │ ├── pyp5js.js
│ │ │ ├── pyp5js.py
│ │ │ ├── python_functions.js
│ │ │ ├── python_functions.py
│ │ │ ├── target_sketch.js
│ │ │ ├── target_sketch.project
│ │ │ └── target_sketch.py
│ │ ├── sketch_005/
│ │ │ ├── index.html
│ │ │ ├── sketch_005.py
│ │ │ ├── static/
│ │ │ │ └── p5.js
│ │ │ └── target/
│ │ │ ├── org.transcrypt.__runtime__.js
│ │ │ ├── org.transcrypt.__runtime__.py
│ │ │ ├── pyp5js.js
│ │ │ ├── pyp5js.py
│ │ │ ├── python_functions.js
│ │ │ ├── python_functions.py
│ │ │ ├── target_sketch.js
│ │ │ ├── target_sketch.project
│ │ │ └── target_sketch.py
│ │ ├── sketch_006/
│ │ │ ├── index.html
│ │ │ ├── sketch_006.py
│ │ │ ├── static/
│ │ │ │ └── p5.js
│ │ │ └── target/
│ │ │ ├── org.transcrypt.__runtime__.js
│ │ │ ├── org.transcrypt.__runtime__.py
│ │ │ ├── pyp5js.js
│ │ │ ├── pyp5js.py
│ │ │ ├── python_functions.js
│ │ │ ├── python_functions.py
│ │ │ ├── target_sketch.js
│ │ │ ├── target_sketch.project
│ │ │ └── target_sketch.py
│ │ ├── sketch_007/
│ │ │ ├── index.html
│ │ │ ├── sketch_007.py
│ │ │ ├── static/
│ │ │ │ └── p5.js
│ │ │ └── target/
│ │ │ ├── org.transcrypt.__runtime__.js
│ │ │ ├── org.transcrypt.__runtime__.py
│ │ │ ├── pyp5js.js
│ │ │ ├── pyp5js.py
│ │ │ ├── python_functions.js
│ │ │ ├── python_functions.py
│ │ │ ├── target_sketch.js
│ │ │ ├── target_sketch.project
│ │ │ └── target_sketch.py
│ │ ├── sketch_008/
│ │ │ ├── index.html
│ │ │ ├── sketch_008.py
│ │ │ ├── static/
│ │ │ │ └── p5.js
│ │ │ └── target/
│ │ │ ├── org.transcrypt.__runtime__.js
│ │ │ ├── org.transcrypt.__runtime__.py
│ │ │ ├── pyp5js.js
│ │ │ ├── pyp5js.py
│ │ │ ├── python_functions.js
│ │ │ ├── python_functions.py
│ │ │ ├── target_sketch.js
│ │ │ ├── target_sketch.project
│ │ │ └── target_sketch.py
│ │ ├── sketch_009/
│ │ │ ├── index.html
│ │ │ ├── sketch_009.py
│ │ │ ├── static/
│ │ │ │ └── p5.js
│ │ │ └── target/
│ │ │ ├── math.js
│ │ │ ├── math.py
│ │ │ ├── org.transcrypt.__runtime__.js
│ │ │ ├── org.transcrypt.__runtime__.py
│ │ │ ├── pyp5js.js
│ │ │ ├── pyp5js.py
│ │ │ ├── python_functions.js
│ │ │ ├── python_functions.py
│ │ │ ├── random.js
│ │ │ ├── random.py
│ │ │ ├── target_sketch.js
│ │ │ ├── target_sketch.project
│ │ │ └── target_sketch.py
│ │ └── sketch_010/
│ │ ├── index.html
│ │ ├── sketch_010.py
│ │ ├── static/
│ │ │ └── p5.js
│ │ └── target/
│ │ ├── org.transcrypt.__runtime__.js
│ │ ├── org.transcrypt.__runtime__.py
│ │ ├── pyp5js.js
│ │ ├── pyp5js.py
│ │ ├── python_functions.js
│ │ ├── python_functions.py
│ │ ├── target_sketch.js
│ │ ├── target_sketch.project
│ │ └── target_sketch.py
│ ├── index.md
│ └── pyodide/
│ ├── afterBody.js
│ ├── index.html
│ ├── index.html.template
│ ├── pyodide.py
│ ├── share.js
│ ├── styles.css
│ └── target/
│ └── target_sketch.js
├── pyp5js/
│ ├── __init__.py
│ ├── cli.py
│ ├── commands.py
│ ├── compiler.py
│ ├── config/
│ │ ├── __init__.py
│ │ ├── fs.py
│ │ └── sketch.py
│ ├── exceptions.py
│ ├── http_local/
│ │ ├── __init__.py
│ │ ├── static/
│ │ │ ├── js/
│ │ │ │ ├── ace/
│ │ │ │ │ ├── ace.js
│ │ │ │ │ ├── ext-beautify.js
│ │ │ │ │ ├── ext-code_lens.js
│ │ │ │ │ ├── ext-elastic_tabstops_lite.js
│ │ │ │ │ ├── ext-emmet.js
│ │ │ │ │ ├── ext-error_marker.js
│ │ │ │ │ ├── ext-keybinding_menu.js
│ │ │ │ │ ├── ext-language_tools.js
│ │ │ │ │ ├── ext-linking.js
│ │ │ │ │ ├── ext-modelist.js
│ │ │ │ │ ├── ext-options.js
│ │ │ │ │ ├── ext-prompt.js
│ │ │ │ │ ├── ext-rtl.js
│ │ │ │ │ ├── ext-searchbox.js
│ │ │ │ │ ├── ext-settings_menu.js
│ │ │ │ │ ├── ext-spellcheck.js
│ │ │ │ │ ├── ext-split.js
│ │ │ │ │ ├── ext-static_highlight.js
│ │ │ │ │ ├── ext-statusbar.js
│ │ │ │ │ ├── ext-textarea.js
│ │ │ │ │ ├── ext-themelist.js
│ │ │ │ │ ├── ext-whitespace.js
│ │ │ │ │ ├── keybinding-emacs.js
│ │ │ │ │ ├── keybinding-sublime.js
│ │ │ │ │ ├── keybinding-vim.js
│ │ │ │ │ ├── keybinding-vscode.js
│ │ │ │ │ ├── mode-python.js
│ │ │ │ │ ├── theme-ambiance.js
│ │ │ │ │ ├── theme-chaos.js
│ │ │ │ │ ├── theme-chrome.js
│ │ │ │ │ ├── theme-clouds.js
│ │ │ │ │ ├── theme-clouds_midnight.js
│ │ │ │ │ ├── theme-cobalt.js
│ │ │ │ │ ├── theme-crimson_editor.js
│ │ │ │ │ ├── theme-dawn.js
│ │ │ │ │ ├── theme-dracula.js
│ │ │ │ │ ├── theme-dreamweaver.js
│ │ │ │ │ ├── theme-eclipse.js
│ │ │ │ │ ├── theme-github.js
│ │ │ │ │ ├── theme-gob.js
│ │ │ │ │ ├── theme-gruvbox.js
│ │ │ │ │ ├── theme-idle_fingers.js
│ │ │ │ │ ├── theme-iplastic.js
│ │ │ │ │ ├── theme-katzenmilch.js
│ │ │ │ │ ├── theme-kr_theme.js
│ │ │ │ │ ├── theme-kuroir.js
│ │ │ │ │ ├── theme-merbivore.js
│ │ │ │ │ ├── theme-merbivore_soft.js
│ │ │ │ │ ├── theme-mono_industrial.js
│ │ │ │ │ ├── theme-monokai.js
│ │ │ │ │ ├── theme-nord_dark.js
│ │ │ │ │ ├── theme-pastel_on_dark.js
│ │ │ │ │ ├── theme-solarized_dark.js
│ │ │ │ │ ├── theme-solarized_light.js
│ │ │ │ │ ├── theme-sqlserver.js
│ │ │ │ │ ├── theme-terminal.js
│ │ │ │ │ ├── theme-textmate.js
│ │ │ │ │ ├── theme-tomorrow.js
│ │ │ │ │ ├── theme-tomorrow_night.js
│ │ │ │ │ ├── theme-tomorrow_night_blue.js
│ │ │ │ │ ├── theme-tomorrow_night_bright.js
│ │ │ │ │ ├── theme-tomorrow_night_eighties.js
│ │ │ │ │ ├── theme-twilight.js
│ │ │ │ │ ├── theme-vibrant_ink.js
│ │ │ │ │ ├── theme-xcode.js
│ │ │ │ │ ├── worker-coffee.js
│ │ │ │ │ ├── worker-css.js
│ │ │ │ │ ├── worker-html.js
│ │ │ │ │ ├── worker-javascript.js
│ │ │ │ │ ├── worker-json.js
│ │ │ │ │ ├── worker-lua.js
│ │ │ │ │ ├── worker-php.js
│ │ │ │ │ ├── worker-xml.js
│ │ │ │ │ └── worker-xquery.js
│ │ │ │ ├── p5/
│ │ │ │ │ ├── addons/
│ │ │ │ │ │ └── p5.sound.js
│ │ │ │ │ └── p5.js
│ │ │ │ └── pyodide/
│ │ │ │ ├── packages.json
│ │ │ │ ├── pyodide.asm.data
│ │ │ │ ├── pyodide.asm.js
│ │ │ │ ├── pyodide.asm.wasm
│ │ │ │ ├── pyodide.js.map
│ │ │ │ └── pyodide_v0.18.1.js
│ │ │ ├── p5_reference.yml
│ │ │ └── styles/
│ │ │ └── custom.css
│ │ ├── templates/
│ │ │ ├── base.html
│ │ │ ├── index.html
│ │ │ ├── new_sketch_form.html
│ │ │ ├── new_sketch_success.html
│ │ │ └── view_sketch.html
│ │ └── web_app.py
│ ├── monitor.py
│ ├── sketch.py
│ ├── templates/
│ │ ├── pyodide/
│ │ │ ├── base_sketch.py.template
│ │ │ ├── index.html
│ │ │ └── target_sketch.js.template
│ │ └── transcrypt/
│ │ ├── base_sketch.py.template
│ │ ├── index.html
│ │ ├── pyp5js.py
│ │ ├── python_functions.py
│ │ └── target_sketch.py.template
│ ├── templates_renderers.py
│ └── tests/
│ ├── __init__.py
│ ├── fixtures.py
│ ├── test_commands.py
│ ├── test_compiler.py
│ ├── test_config/
│ │ ├── __init__.py
│ │ ├── test_fs.py
│ │ └── test_sketch.py
│ ├── test_http/
│ │ └── test_web_app.py
│ ├── test_monitor.py
│ ├── test_pyp5js.py
│ ├── test_sketch.py
│ └── test_templates_renderers.py
├── pytest.ini
├── requirements.txt
└── setup.py
================================================
FILE CONTENTS
================================================
================================================
FILE: .github/workflows/ci.yml
================================================
name: Continuous Integration
on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
- develop
jobs:
license:
name: Check source files for license headers
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Check for license headers
run: bash bin/check_license.sh
test:
name: Test on ${{ matrix.os }} with Python ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
max-parallel: 4
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
python-version: [3.7, 3.8, 3.9, '3.10']
steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Display python version
run: python --version
- name: Upgrade pip
run: python -m pip install --upgrade pip setuptools --user
- name: Install dev dependencies
run: pip install -r dev-requirements.txt
- name: Install pyp5js for dev
run: python setup.py develop --install-dir dist
- name:
run: python -m pytest
================================================
FILE: .gitignore
================================================
.Python
.DS_Store
*.pyc
.vscode
*.env
*.swp
*.swo
*.swn
*.sqlite3
*.map
!pyodide.js.map
__target__
build
dist
*.egg-info
demo_sketch
tests-sketchbook
venv
docs/examples/dev*
docs/examples/issue*
.theia
.envrc
*.properties.json
.idea/*
================================================
FILE: .gitpod.yml
================================================
image: gitpod/workspace-full
ports:
- port: 5000
onOpen: open-browser
tasks:
- init:
export SKETCHBOOK_DIR=sketchbook &&
python -m venv venv --system-site-packages &&
venv/bin/pip install -r dev-requirements.txt &&
venv/bin/python setup.py develop &&
source venv/bin/activate &&
pytest
command: pyp5js serve
================================================
FILE: CHANGELOG.md
================================================
Development
-----------
- Add `--version` parameter to the command line interface [PR #223](https://github.com/berinhard/pyp5js/pull/223)
0.7.3
-----
- Fix bug on 0.7.2 verison without required local web server template files.
0.7.2
-----
- 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)
- Upgrade pyp5js dependencies versions [PR #220](https://github.com/berinhard/pyp5js/pull/220)
- Run CI for Python 3.10 version [PR #219](https://github.com/berinhard/pyp5js/pull/219)
0.7.1
-----
- Create sketch using p5.js from CDN [PR #191](https://github.com/berinhard/pyp5js/pull/191)
- Add `keyIsDown` event to Transcrypt mode - [PR #187](https://github.com/berinhard/pyp5js/pull/187)
- Fix bug with multiple events calls - PR #187 too
- Serve JS files if `--local` flag [PR #195](https://github.com/berinhard/pyp5js/pull/195)
- Force `utf-8` as the lib's default encoding [PR #193](https://github.com/berinhard/pyp5js/pull/193)
- Fix preload function bug in both modes - [PR #196](https://github.com/berinhard/pyp5js/pull/196)
0.7.0
-----
- Remove `from pyp5js import *` requirement under transcrypt [PR #183](https://github.com/berinhard/pyp5js/pull/183/)
- Make local code editor collapsible [PR #184](https://github.com/berinhard/pyp5js/pull/184/)
- Add `mouseWheel` event to Pyodide's demo [PR #185](https://github.com/berinhard/pyp5js/pull/185/)
0.6.0
-----
- Add transcrypt interpreter choice to web editor - [PR #175](https://github.com/berinhard/pyp5js/pull/175)
- Upgrade Transcrypt to 3.9.0
- Upgrade Pyodide to v0.18.1 - [PR #181](https://github.com/berinhard/pyp5js/pull/181)
- Enable to use custom templates files to generate and compile index.html - [PR #177](https://github.com/berinhard/pyp5js/pull/177)
- Add docs on Pyodide examples - [PR #178](https://github.com/berinhard/pyp5js/pull/178)
0.5.2
-----
- Pyodide mode bugfix for missing `P3D` global definition
- Processing-like PVector class under transcrypt mode
- Processing-like PVector class under pyodide mode
0.5.1
-----
- Minor fix in view sketch HTML
0.5.0
-----
- Support to Pyodide as the Python interpreter
0.4.5
-----
- Support to get/set pixels with Transcrypt interpreter
- `pyp5js` can run on top of Gitpod.io
0.4.4
-----
- Fix to allow directories name with spaces - PR #127
0.4.3
-----
- Fix conflict with p5.js `clear` method and Python
- Upgrade `p5.js` version to `1.0.0`
- Use local file for Ace editor
0.4.2
-----
- Keep Python functions with name conflict with p5.js working as expected
- `createCanvas` now returns `p5.Renderer`
- Fix `transcrypt` error on Windows
- Add support to `loadImage`
0.4.1
-----
- Fix bug of null `_P5_INSTANCE`
0.4.0
-----
- Display sketch with code
- Add ACE editor to edit the sketch code
- Add aliases to Processing.py functions & constants (`size`, `pushMatrix`, `popMatrix`, `pushStyle`, `pushStyle`, `P3D`)
0.3.5
-----
- Fix issue with assets
0.3.4
-----
- Update sketch's template
- Add unit tests to the Flask API
- Base style for the web client
0.3.3
-----
- Validate sketch name
- Add base templates for the web app
- Add iframe with example 000 to the index
0.3.2
-----
- Ensure the sketchbook dir always exists
0.3.1
-----
- Fix build without web application assets
0.3.0
-----
- Create `pyp5js serve` command
- Add `SKETCHBOOK_DIR` to configure the sketchbook's directory
- Local web app to compile sketches on the fly and to create sketches
0.2.0
-----
- Rename pyp5.js module from pytop5js to pyp5js
- Enable keyword argument
- Enable checking for existence in dictionary keys
- Commands now printing index files as URI
0.1.1
-----
- Fix install issue
0.1.0
-----
- Simplification of pytop5js usage
- Support p5.dom.js library
- Fixes on monitor observer
0.0.7
-----
- Fix bug with monitor not running transcrypt more than once
0.0.6
-----
- Add flag on new commmand to monitor sketch after creating it
- Fix bug when running the monitor command from the sketch's directory
- Update width and height values on createCanvas
0.0.5
-----
- Add all p5's missing global variables
0.0.4.1
-------
- Support event functions such as `keyPressed`
0.0.4
-----
- Support p5.js pop function
- Add `monitor` command to the CLI
- Allow to run `pyp5js` commands specifying a directory
- First try on organizing the docs
0.0.3
-----
- Add WEBGL variables
0.0.2
-----
- Support more of P5's variable
0.0.1
-----
- First release
================================================
FILE: CONTRIBUTING.md
================================================
## Contributing to pyp5js
Here you'll find all possible ways to contribute to the project.
### Testing, testing and testing
Since pyp5js have a lot of moving parts, it would be great to have the p5.js API fully covered and tested. So, use your imagination, code your sketches and, if pyp5js breaks or starts to annoy you with something, you're very welcome to [open an issue](https://github.com/berinhard/pyp5js/issues/new) documenting your thoughts. Test it and let me know how can I improve it.
### What about these shinning examples?
If you fell confortable with that, I'd be happy to add some of your pyp5js sketches to our [examples list](https://berinhard.github.io/pyp5js/examples/)! To do so, you'll have [to fork this repository](https://help.github.com/en/articles/fork-a-repo) and add your new sketch example in the `docs/examples` directory. Once you've your sketch ready, you can [open a pull request](https://help.github.com/en/articles/about-pull-requests) and I'll take a look at it.
### I want to hack!
Okay, if you want to contribute with pyp5js's code, let's go! I really advise you to use [virtualenv with virtualenvwrapper](http://www.indjango.com/python-install-virtualenv-and-virtualenvwrapper/) or [pyenv](https://amaral.northwestern.edu/resources/guides/pyenv-tutorial) to isolate your pyp5js fork from the rest of your system. Once you have everything ready, you can run:
```
$ git clone git@github.com:YOUR_GITHUB_PROFILE/pyp5js.git
$ cd pyp5js
$ pip install -r dev-requirements.txt
$ python setup.py develop
$ make test
```
After that, you should have the `pyp5js` command enabled and it will respect all the changes you introduce to the code. Now, a brief explanation about the code under `pyp5js` directory:
- `config` module: centralize pieces of code used to configure how `pyp5js` runs
- `cli.py`: the entrypoint for `pyp5js` commands such as `new` or `compile`
- `commands.py`: just functions responsible for the real implementations for `pyp5js` commands
- `compiler.py`: where all the magic happens!
- `exception.py`: custom exceptions used by `pyp5js`
- `monitor.py`: module with the objects used by the `monitor` command
- `sketch.py`: class to abstract Sketches' files, directories and configuration
- `template_renderers.py`: simple module with the renderization logic for the code templates like `target_sketch.py`
- `http/web_app.py`: Flask application for the web interface.
Now go [fetch yourself an issue](https://github.com/berinhard/pyp5js/issues) and happy hacking!
================================================
FILE: LICENSE
================================================
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc.
Python code here.
x = 50
y = 100
rad = 6
vx = 5
vy = 5
WIDTH = 640
HEIGHT = 400
FPS = 60
def setup():
createCanvas(WIDTH, HEIGHT)
frameRate(FPS)
def draw():
global x, y, vx, vy
background(220)
fill(0, 255, 0)
ellipse(x, y, 2 * rad)
x += vx
y += vy
if (x + rad >= width or x - rad <= 0):
vx = -vx
if (y + rad >= height or y - rad <= 0):
vy = -vy
>>16,e[r+1]=(65280&t[i])>>>8,e[r+2]=255&t[i],e[r+3]=(4278190080&t[i])>>>24},O._toImageData=function(e){return e instanceof ImageData?e:e.getContext("2d").getImageData(0,0,e.width,e.height)},O._createImageData=function(e,t){return O._tmpCanvas=document.createElement("canvas"),O._tmpCtx=O._tmpCanvas.getContext("2d"),this._tmpCtx.createImageData(e,t)},O.apply=function(e,t,r){var i=e.getContext("2d"),n=i.getImageData(0,0,e.width,e.height),o=t(n,r);o instanceof ImageData?i.putImageData(o,0,0,0,0,e.width,e.height):i.putImageData(n,0,0,0,0,e.width,e.height)},O.threshold=function(e,t){var r=O._toPixels(e);void 0===t&&(t=.5);for(var i=Math.floor(255*t),n=0;n"),"0"!==o[0]){n.print("
"),n.print(""),n.print("");for(var h=0;h ")}for(var f=0;f