New component: Python Script (#7950)

* Add initial version

* Fix requirements

* Prefer logging over printing

* Set executor thread name on >Py36 only

* Add tests

* Lint

* Add restrictedpython to test dependencies

* Create python_script.py

From doc:
```
However, an empty dict ({}) is treated as is. If you want to specify a list that can contain anything, specify it as dict:
>>> schema = Schema({}, extra=ALLOW_EXTRA)  # don't do this
>>> try:
...   schema({'extra': 1})
...   raise AssertionError('MultipleInvalid not raised')
... except MultipleInvalid as e:
...   exc = e
>>> str(exc) == "not a valid value"
True
>>> schema({})
{}
>>> schema = Schema(dict)  # do this instead
>>> schema({})
{}
>>> schema({'extra': 1})
{'extra': 1}

```
This commit is contained in:
Paulus Schoutsen 2017-06-09 03:38:40 -07:00 committed by Pascal Vizeli
parent 640c692e1f
commit db0efc647d
6 changed files with 223 additions and 1 deletions

View file

@ -65,6 +65,7 @@ TEST_REQUIREMENTS = (
'gTTS-token',
'pywebpush',
'PyJWT',
'restrictedpython',
)
IGNORE_PACKAGES = (