New --plugins-dir=plugins/ option (#212)

* New --plugins-dir=plugins/ option

New option causing Datasette to load and evaluate all of the Python files in
the specified directory and register any plugins that are defined in those
files.

This new option is available for the following commands:

    datasette serve mydb.db --plugins-dir=plugins/
    datasette publish now/heroku mydb.db --plugins-dir=plugins/
    datasette package mydb.db --plugins-dir=plugins/

* Unit tests for --plugins-dir=plugins/

Closes #211
This commit is contained in:
Simon Willison 2018-04-15 22:22:01 -07:00 committed by GitHub
commit b2955d9065
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 86 additions and 12 deletions

View file

@ -195,6 +195,7 @@ def test_temporary_docker_directory_uses_hard_link():
extra_options=None,
branch=None,
template_dir=None,
plugins_dir=None,
static=[],
) as temp_docker:
hello = os.path.join(temp_docker, 'hello')
@ -218,6 +219,7 @@ def test_temporary_docker_directory_uses_copy_if_hard_link_fails(mock_link):
extra_options=None,
branch=None,
template_dir=None,
plugins_dir=None,
static=[],
) as temp_docker:
hello = os.path.join(temp_docker, 'hello')