├── .coveragerc
├── .gitignore
├── .gitmodules
├── .green
├── .jshintrc
├── .travis.yml
├── CHANGES.rst
├── LICENSE
├── MANIFEST.in
├── Makefile
├── README.rst
├── docs
├── Makefile
├── _static
│ ├── custom.css
│ ├── custom_ja.css
│ └── skyblue.min.css
├── _templates
│ └── layout.html
├── changes.rst
├── conf.py
├── dom.rst
├── event.rst
├── guide
│ ├── dom.md
│ ├── freezing.md
│ ├── index.rst
│ ├── load_resource.md
│ ├── new_features.md
│ ├── samples
│ │ ├── dom1.py
│ │ ├── dom2.py
│ │ ├── dom3.py
│ │ ├── dom4.py
│ │ ├── new1.py
│ │ ├── new2.py
│ │ ├── new3.py
│ │ ├── static1.py
│ │ ├── static2.py
│ │ ├── static3.py
│ │ ├── wdom1.py
│ │ ├── wdom2.py
│ │ ├── wdom3.py
│ │ ├── wdom4.py
│ │ ├── wdom5.py
│ │ ├── wdom6.py
│ │ └── wdom7.py
│ ├── theming.md
│ └── wdom.md
├── index.rst
├── node.rst
├── reference.rst
├── server.py
├── tag.rst
└── webserver.md
├── dodo.py
├── mypy.ini
├── profile
└── parser.py
├── requirements-dev.txt
├── requirements-docs.txt
├── requirements-test.txt
├── setup.py
├── tests
├── __init__.py
├── base.py
├── server
│ ├── __init__.py
│ ├── base.py
│ └── test_server.py
├── test_css.py
├── test_document.py
├── test_element.py
├── test_event.py
├── test_imports.py
├── test_node.py
├── test_options.py
├── test_parser.py
├── test_pyppeteer
│ ├── __init__.py
│ ├── base.py
│ ├── test_examples.py
│ ├── test_node.py
│ └── test_tag.py
├── test_selenium
│ ├── __init__.py
│ ├── base.py
│ ├── test_example_module.py
│ ├── test_examples.py
│ ├── test_node.py
│ ├── test_server.py
│ ├── test_tag.py
│ └── testdir
│ │ └── test.css
├── test_tag.py
├── test_testing.py
├── test_themes.py
├── test_web_node.py
└── test_window.py
├── tox.ini
└── wdom
├── __init__.py
├── _static
├── css
│ ├── bagpakk.min.css
│ ├── baseguide.min.css
│ ├── bijou.min.css
│ ├── groundwork.css
│ ├── kathamo.min.css
│ ├── kube.min.css
│ ├── pure-extra.css
│ ├── schema.min.css
│ ├── siimple.min.css
│ ├── skyblue.min.css
│ ├── spark.min.css
│ └── spectre.min.css
├── favicon.ico
└── js
│ ├── groundwork.all.js
│ ├── spark.min.js
│ └── wdom.js
├── _template
├── page.html
└── page.mustache
├── css.py
├── document.py
├── element.py
├── event.py
├── examples
├── __init__.py
├── data_binding.py
├── drag.py
├── global_events.py
├── markdown_simple.py
├── rev_text.py
├── theming.py
├── timer.py
└── todo.py
├── node.py
├── options.py
├── parser.py
├── server
├── __init__.py
├── _tornado.py
├── base.py
└── handler.py
├── tag.py
├── themes
├── __init__.py
├── bagpakk.py
├── baseguide.py
├── bijou.py
├── blaze.py
├── bootstrap3.py
├── bootstrap4.py
├── bulma.py
├── concise.py
├── default.py
├── foundation.py
├── furtive.py
├── groundwork.py
├── ink.py
├── kathamo.py
├── kube.py
├── mdl.py
├── milligram.py
├── mui.py
├── papier.py
├── picnic.py
├── pure.py
├── schema.py
├── semantic.py
├── siimple.py
├── skeleton.py
├── skyblue.py
├── spark.py
├── spectre.py
└── vital.py
├── util.py
├── web_node.py
└── window.py
/.coveragerc:
--------------------------------------------------------------------------------
1 | [run]
2 | omit=*/themes/*,*/examples/*,wdom/__main__.py,setup.py
3 | source=wdom,tests
4 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Byte-compiled / optimized / DLL files
2 | __pycache__/
3 | *.py[cod]
4 | *$py.class
5 |
6 | # C extensions
7 | *.so
8 |
9 | # Distribution / packaging
10 | .Python
11 | env/
12 | build/
13 | develop-eggs/
14 | dist/
15 | downloads/
16 | eggs/
17 | .eggs/
18 | lib/
19 | lib64/
20 | parts/
21 | sdist/
22 | var/
23 | *.egg-info/
24 | .installed.cfg
25 | *.egg
26 |
27 | # Virtualenv
28 | bin/
29 | lib/
30 | lib64
31 | pyvenv.cfg
32 |
33 | # PyInstaller
34 | # Usually these files are written by a python script from a template
35 | # before PyInstaller builds the exe, so as to inject date/other infos into it.
36 | *.manifest
37 | *.spec
38 |
39 | # Installer logs
40 | pip-log.txt
41 | pip-delete-this-directory.txt
42 |
43 | # Unit test / coverage reports
44 | htmlcov/
45 | .tox/
46 | .coverage
47 | .coverage.*
48 | .cache
49 | .mypy_cache
50 | nosetests.xml
51 | coverage.xml
52 | *,cover
53 | .hypothesis/
54 |
55 | # Translations
56 | *.mo
57 | *.pot
58 |
59 | # Django stuff:
60 | *.log
61 |
62 | # Sphinx documentation
63 | docs/_build/
64 |
65 | # PyBuilder
66 | target/
67 |
68 | # pyenv python configuration file
69 | .python-version
70 |
71 | ###### direnv ######
72 | .direnv
73 | .envrc
74 |
75 | ###### zsh-autoenv ######
76 | .autoenv.zsh
77 | .autoenv_leave.zsh
78 |
79 | ### project specific ignore files
80 | wiki
81 | tmp
82 | .bumpversion.cfg
83 | pytest.xml
84 | chromedriver
85 |
86 | # node files
87 | node_modules
88 |
89 | # phantomjs
90 | ghostdriver.log
91 |
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/miyakogi/wdom/a21bcd23e94baceee71161829f6897bee3fd39c1/.gitmodules
--------------------------------------------------------------------------------
/.green:
--------------------------------------------------------------------------------
1 | verbose=1
2 | initializer=wdom.util.suppress_logging
3 | omit-patterns=*/themes/*,*/exapmles/*
4 |
--------------------------------------------------------------------------------
/.jshintrc:
--------------------------------------------------------------------------------
1 | {
2 | // Enhancement
3 | "unused": true,
4 | "undef": true,
5 |
6 | // Environments
7 | "browser": true,
8 | "devel": true,
9 | "esversion": 6,
10 |
11 | // Relaxes
12 | "asi": true,
13 | "sub": true,
14 |
15 | // Global variables
16 | "globals": {
17 | "riot": false
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | sudo: false
2 | dist: trustry
3 | language: python
4 |
5 | matrix:
6 | include:
7 | - python: 3.5
8 | env: TOXENV=py35
9 | - python: 3.6
10 | env: TOXENV=py36,flake8,mypy,pydocstyle,docs,codecov
11 |
12 | addons:
13 | chrome: stable
14 |
15 | install:
16 | - pip install tox
17 |
18 | script:
19 | - tox
20 |
--------------------------------------------------------------------------------
/CHANGES.rst:
--------------------------------------------------------------------------------
1 | Version 0.4 (next version)
2 | --------------------------
3 |
4 | Version 0.3.1 (2018-03-06)
5 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6 |
7 | * Update for tornado 5.0
8 | * [test] Update for pyppeteer 0.0.12
9 |
10 | Version 0.3 (2017-09-14)
11 | ------------------------
12 |
13 | * Remove testing module from wdom package
14 | * Rename rimo.js to wdom.js
15 |
16 | Version 0.2.1 (2017-08-11)
17 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
18 |
19 | * Change metadata
20 |
21 | Version 0.2.0 (2017-08-11)
22 | --------------------------
23 |
24 | * **Python 3.4 is NOT Supported**
25 | * Use async/await
26 | * Add type hints (pass mypy check)
27 | * Write docstrings (pass pydocstyle check)
28 | * Enable ``python setup.py test``
29 | * Moved ``suppress_logging`` function from ``wdom.testing`` to ``wdom.misc``
30 | * Improve auto-reload sequence
31 | * Parse html using custom elements
32 | * Find elements from customElementsRegistory
33 | * Move non-standard tag classes from ``wdom.tag`` to ``wdom.themes``
34 | * Add ``wdom.tag.RawHtmlNode`` class
35 | * Support more events
36 | * Keyboard event support
37 | * Document/Window level event support
38 | * Drag and drop event support
39 |
40 | Version 0.1.8 (2017-07-23)
41 | ^^^^^^^^^^^^^^^^^^^^^^^^^^
42 |
43 | * Raise warning if python version is < 3.5
44 | * Improve HTML parsing
45 | * Don't send events to unmounted DOM
46 | * Send multiple WS messages once
47 |
48 | Version 0.1.7 (2017-07-21)
49 | ^^^^^^^^^^^^^^^^^^^^^^^^^^
50 |
51 | * Update PyPI metadata
52 | * Add shortcut functions (``server.start()`` and ``document.set_app()``)
53 |
54 | Version 0.1.6 (2017-07-21)
55 | ^^^^^^^^^^^^^^^^^^^^^^^^^^
56 |
57 | * Drop aiohttp support
58 |
59 | Version 0.1.5 (2017-06-03)
60 | ^^^^^^^^^^^^^^^^^^^^^^^^^^
61 |
62 | * Tentatively disable aiohttp
63 | * Catch up recent updates
64 | * Add Concise CSS
65 |
66 | Version 0.1.4 (2016-05-20)
67 | ^^^^^^^^^^^^^^^^^^^^^^^^^^
68 |
69 | * Examples are executable by one file
70 | * Upload document to readthedocs
71 |
72 | Version 0.1.3 (2016-05-17)
73 | ^^^^^^^^^^^^^^^^^^^^^^^^^^
74 |
75 | * (bug fix) Add dependency of mypy-lang for python < 3.5
76 |
77 | Version 0.1.2 (2016-05-15)
78 | ^^^^^^^^^^^^^^^^^^^^^^^^^^
79 |
80 | * ``TestCase.wait`` methods take two argument, ``timeout`` and ``times``.
81 | * Add ``wait_until`` method and ``timeout`` class variable on ``TestCase``.
82 | * Default value of ``TestCase.wait_time`` is same as local and travis ci. If
83 | longer wait time is required on travis, change ``wait_time`` on each test
84 | case.
85 | * Support access log on aiohttp server
86 |
87 | Version 0.1.1 (2016-05-15)
88 | ^^^^^^^^^^^^^^^^^^^^^^^^^^
89 |
90 | * minor update on meta data
91 |
92 | Version 0.1 (2016-05-15)
93 | ------------------------
94 |
95 | First public release.
96 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2016 Hitoruki Takagi
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/MANIFEST.in:
--------------------------------------------------------------------------------
1 | include LICENSE
2 | include README.rst
3 | include wdom/_static/js/wdom.js
4 |
5 | recursive-include tests *.py *.css
6 | recursive-include wdom/_static/css *.css
7 | recursive-exclude * __pycache__
8 | recursive-exclude * *.py[co]
9 |
10 | recursive-include docs *.rst conf.py Makefile make.bat *.css *.js *.html
11 | recursive-exclude docs/_build *
12 |
--------------------------------------------------------------------------------
/Makefile:
--------------------------------------------------------------------------------
1 | .PHONY: release release-pypi release-github
2 | .PHONY: clean clean-test clean-pyc clean-build docs help
3 | .DEFAULT_GOAL := help
4 | define BROWSER_PYSCRIPT
5 | import os, webbrowser, sys
6 | try:
7 | from urllib import pathname2url
8 | except:
9 | from urllib.request import pathname2url
10 |
11 | webbrowser.open("file://" + pathname2url(os.path.abspath(sys.argv[1])))
12 | endef
13 | export BROWSER_PYSCRIPT
14 |
15 | define PRINT_HELP_PYSCRIPT
16 | import re, sys
17 |
18 | for line in sys.stdin:
19 | match = re.match(r'^([a-zA-Z_-]+):.*?## (.*)$$', line)
20 | if match:
21 | target, help = match.groups()
22 | print("%-20s %s" % (target, help))
23 | endef
24 | export PRINT_HELP_PYSCRIPT
25 | BROWSER := python -c "$$BROWSER_PYSCRIPT"
26 |
27 | help:
28 | @python -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST)
29 |
30 | clean: clean-build clean-pyc clean-test ## remove all build, test, coverage and Python artifacts
31 |
32 | clean-build: ## remove build artifacts
33 | @echo "Remove build files (build/, dist/, .egg*, ...)."
34 | @rm -fr build/
35 | @rm -fr dist/
36 | @rm -fr .eggs/
37 | @find . -name '*.egg-info' -exec rm -fr {} +
38 | @find . -name '*.egg' -exec rm -f {} +
39 |
40 | clean-pyc: ## remove Python file artifacts
41 | @echo "Remove python files (*.py[co], __pycache__, ...)."
42 | @find . -name '*.pyc' -exec rm -f {} +
43 | @find . -name '*.pyo' -exec rm -f {} +
44 | @find . -name '*~' -exec rm -f {} +
45 | @find . -name '__pycache__' -exec rm -fr {} +
46 |
47 | clean-test: ## remove test and coverage artifacts
48 | @echo "Remove test/coverage files (.coverage, htmlcov/)."
49 | @rm -f .coverage
50 | @rm -fr htmlcov/
51 | @rm -f wdom/tests/browser/server/tmp*.py
52 |
53 | release: release-pypi release-github ## register pypi and push tags to github
54 |
55 | release-pypi: ## register pypi
56 | python setup.py sdist upload
57 |
58 | release-github: ## push tags to gihub
59 | git push origin --tags
60 |
61 | .PHONY: green green-cov green-single unittests
62 | green: ## run green test
63 | @echo "Run green."
64 | @cd maint && \
65 | green -c ../.green ../wdom
66 |
67 | green-cov: # run green and calculate coverage
68 | @echo "Run green with coverage."
69 | @cd maint && \
70 | green -r -c ../.green ../wdom
71 |
72 | green-single: ## run green with a single process
73 | @echo "Run green with a single process."
74 | @cd maint && \
75 | green -s 1 -c ../.green ../wdom
76 |
77 | unittest: ## run python's unitttest
78 | @python -W ignore::ResourceWarning -m unittest discover wdom/tests
79 |
80 | .PHONY: flake8
81 | flake8: ## run flake8 syntax check
82 | flake8 wdom setup.py
83 |
84 | .PHONY: mypy
85 | mypy: ## run mypy type check
86 | mypy wdom
87 |
88 | .PHONY: pydocstyle
89 | pydocstyle: ## run pydocstyle check
90 | pydocstyle wdom
91 |
92 | # -n option is better but type hints refs are not found
93 | .PHONY: docs
94 | docs: ## build document
95 | @echo "Sphinx build start."
96 | sphinx-build -q -E -W -j 4 -b html docs docs/_build/html
97 | @echo "Sphinx build done."
98 |
99 | .PHONY: sphinx
100 | sphinx: ## run document build server
101 | @echo "### Sphinx Build Server Start ###"
102 | @python docs/server.py
103 |
104 | .PHONY: check
105 | check: ## run flake8, mypy, pydocstyle, sphinx-build
106 | @doit --verbosity 1 --process 4 --parallel-type thread
107 |
108 | .PHONY: test-all
109 | test-all: check green-cov ## run style check and test
110 |
--------------------------------------------------------------------------------
/docs/_static/custom.css:
--------------------------------------------------------------------------------
1 | h1.logo, div.section#wdom > h1 {
2 | font-family: "Raleway";
3 | font-weight: 500;
4 | }
5 |
6 | a.headerlink {
7 | color: rgba(0, 0, 0, 0.1);
8 | }
9 |
10 | div.sphinxsidebarwrapper p.blurb {
11 | font-family: Lato, sans-serif;
12 | }
13 |
14 | div.sphinxsidebar li.toctree-l1 {
15 | font-family: Lato, sans-serif;
16 | }
17 |
18 | body {
19 | background-color: #fafafa
20 | }
21 |
22 | .search-btn {
23 | padding: 0 1em;
24 | font-family: Lato, sans-serif;
25 | font-weight: normal;
26 | line-height: normal;
27 | align-self: stretch;
28 | }
29 |
--------------------------------------------------------------------------------
/docs/_static/custom_ja.css:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/docs/_templates/layout.html:
--------------------------------------------------------------------------------
1 | {% extends 'alabaster/layout.html' %}
2 | {% block extrahead %}
3 |
4 |
5 |
6 |
7 |
8 |
9 | {{ super() }}
10 | {% endblock %}
11 |
--------------------------------------------------------------------------------
/docs/changes.rst:
--------------------------------------------------------------------------------
1 | Changes
2 | =======
3 |
4 | .. include:: ../CHANGES.rst
5 |
--------------------------------------------------------------------------------
/docs/dom.rst:
--------------------------------------------------------------------------------
1 | DOM API
2 | =======
3 |
4 | (This section is not complete and not enough yet...)
5 |
6 | .. toctree::
7 | tag
8 | node
9 |
--------------------------------------------------------------------------------
/docs/event.rst:
--------------------------------------------------------------------------------
1 | Event API
2 | =========
3 |
4 | .. currentmodule:: wdom.event
5 |
6 | .. autoclass:: wdom.event.Event
7 | :members:
8 |
9 | .. autoclass:: wdom.event.MouseEvent
10 | :members:
11 |
12 | .. autoclass:: wdom.event.KeyboardEvent
13 | :members:
14 |
15 | .. autoclass:: wdom.event.DragEvent
16 | :members:
17 |
18 | .. autoclass:: wdom.event.DataTransfer
19 | :members:
20 |
21 | .. autofunction:: wdom.event.create_event
22 |
23 | .. autoclass:: wdom.event.EventListener
24 | :members:
25 |
26 | .. autoclass:: wdom.event.EventTarget
27 | :members:
28 |
--------------------------------------------------------------------------------
/docs/guide/freezing.md:
--------------------------------------------------------------------------------
1 | Freezing Application
2 | ====================
3 |
4 | (to be described)
5 |
6 | Using cx_Freeze
7 | --------------
8 |
9 | (to be described)
10 |
11 | Using Electron
12 | -------------
13 |
14 | (to be described)
15 |
--------------------------------------------------------------------------------
/docs/guide/index.rst:
--------------------------------------------------------------------------------
1 | User Guide
2 | ==========
3 |
4 | .. note::
5 | This document is still incomplete, and will contain typos and mistakes in
6 | grammar due to my poor English skill. If you find any incorrect expression,
7 | please let me know at `issues `_ or
8 | send `PR `_. Any small improvements
9 | or suggestions (e.g. just changing **a** to **the**) are welcome!
10 |
11 | Contents
12 | --------
13 |
14 | .. toctree::
15 | :maxdepth: 2
16 |
17 | dom
18 | wdom
19 | load_resource
20 | new_features
21 | theming
22 | freezing
23 |
--------------------------------------------------------------------------------
/docs/guide/load_resource.md:
--------------------------------------------------------------------------------
1 | Loading Static Contents
2 | =======================
3 |
4 | Contents on the Web
5 | -------------------
6 |
7 | As an example, use `bootstrap`_.
8 |
9 | To use bootstrap, one css file (bootstrap.min.css) and two js files (jquery and
10 | bootstrap.min.js) are need to be loaded.
11 | To load css file, use `` tag and insert into the ``.
12 | And to load js files, use `
20 | {% end %}
21 |
27 |
28 |