From 1ee19ea640373a7ea63c265be58134a0d2090d52 Mon Sep 17 00:00:00 2001 From: SrMouraSilva Date: Sat, 17 Feb 2018 17:33:24 -0300 Subject: [PATCH 01/24] #45 Create makefile --- .travis.yml | 9 ++++++ README.rst | 19 ++++++------ makefile | 83 +++++++++++++++++++++++++++++++++++++++++++++++++++++ setup.py | 2 +- 4 files changed, 104 insertions(+), 9 deletions(-) create mode 100644 makefile diff --git a/.travis.yml b/.travis.yml index 72fa0ff..11d0ab9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,6 +9,15 @@ python: sudo: required +jobs: + include: + - stage: unit-test + script: make test + - stage: doc + script: make install-docs-requirements + - stage: deploy + script: ./deploy + install: - sudo apt-get update - sudo apt-get install -y portaudio19-dev python-all-dev --no-install-recommends diff --git a/README.rst b/README.rst index 776b06a..671c9fc 100644 --- a/README.rst +++ b/README.rst @@ -79,7 +79,7 @@ The registration must occur before application initialization (``application.sta application = Application(path_data="data/", address='localhost') from webservice.webservice import WebService - application.register(WebService(application, port)) + application.register(WebService(application, port=3000)) 2. Initialization of the web server +++++++++++++++++++++++++++++++++++ @@ -122,7 +122,7 @@ look like the following code: application = Application(path_data="data/", address='localhost') from webservice.webservice import WebService - application.register(WebService(application, port)) + application.register(WebService(application, port=3000)) application.start() @@ -163,17 +163,20 @@ Maintenance Documentation ************* +Is necessary to install `nodejs`_. + +.. _nodejs: https://nodejs.org/en/ + .. code-block:: bash # Installing dependencies - npm install -g aglio + make install-docs-requirements # Generate doc - cd docs/ - aglio -i documentation.apib --theme-variables streak --theme-template triple -o index.html + make docs # View documentation - firefox index.html + make docs-see Test **** @@ -185,5 +188,5 @@ Test coverage3 run --source=webservice wstest/config.py test coverage3 report - coverage3 html - firefox htmlcov/index.html + make test-details + diff --git a/makefile b/makefile new file mode 100644 index 0000000..ef9052d --- /dev/null +++ b/makefile @@ -0,0 +1,83 @@ +BROWSER=firefox +BOLD=\033[1m +NORMAL=\033[0m + +default: help + +FIXME clean: clean-pyc clean-test clean-build clean-docs + +FIXME clean-build: + rm -rf .eggs + rm -rf build + rm -rf dist + +FIXME clean-pyc: + find . -name '*.pyc' -exec rm --force {} + + find . -name '*.pyo' -exec rm --force {} + + +FIXME clean-test: + rm -rf .cache + rm -f .coverage + rm -rf htmlcov + rm -rf wstest/data + +clean-docs: + rm -f docs/index.html + +docs: clean-docs + cd docs && aglio -i documentation.apib --theme-variables streak --theme-template triple -o index.html + +docs-see: docs + $(BROWSER) docs/index.html + +install-docs-requirements: + npm install -g aglio + +FIXME install-tests-requirements: + # For midi tests - https://github.com/x42/midifilter.lv2 + cd /tmp && git clone git://github.com/x42/midifilter.lv2.git && \ + cd midifilter.lv2 && \ + make && \ + sudo make install PREFIX=/usr + +run: + @echo "Run option isn't created =)" + +test: clean-test + coverage3 run --source=webservice wstest/config.py test + +FIXME test-docs: + python -m doctest *.rst -v + python -m doctest docs/*/*.rst -v + +test-details: test + coverage3 html + $(BROWSER) htmlcov/index.html + +help: cabecalho + @echo "" + @echo "Commands" + @echo " $(BOLD)clean$(NORMAL)" + @echo " Clean files" + @echo " $(BOLD)docs$(NORMAL)" + @echo " Make the docs" + @echo " $(BOLD)docs-see$(NORMAL)" + @echo " Make the docs and open it in BROWSER" + @echo " $(BOLD)install-docs-requirements$(NORMAL)" + @echo " Install the docs requirements" + @echo " $(BOLD)install-tests-requirements$(NORMAL)" + @echo " Install the tests requirements" + @echo " $(BOLD)test$(NORMAL)" + @echo " Execute the tests" + @echo " $(BOLD)test-details$(NORMAL)" + @echo " Execute the tests and shows the result in BROWSER" + @echo " - BROWSER=firefox" + @echo " $(BOLD)help$(NORMAL)" + @echo " Show the valid commands" + +cabecalho: + @echo "$(BOLD) _ _ ____ ____ ____ ____ ____ _ _ __ ___ ____" + @echo "/ )( ( __| _ \/ ___| __| _ \/ )( ( ) __| __)" + @echo "\ /\ /) _) ) _ (\___ \) _) ) /\ \/ /)( (__ ) _) " + @echo "(_/\_|____|____/(____(____|__\_) \__/(__)___|____)" + @echo "Link$(NORMAL): https://pypi.org/project/PedalPi-WebService/" diff --git a/setup.py b/setup.py index dc54ea7..4697ce9 100644 --- a/setup.py +++ b/setup.py @@ -50,7 +50,7 @@ def readme(): install_requires=[ 'PedalPi-Application>=0.3.0', - 'tornado>=4.4.2', + 'tornado>=4.5.3', 'tornado-cors==0.6.0', 'zeroconf' ], From 79bcee80370c9f0d1418992d75ab3444706cb26b Mon Sep 17 00:00:00 2001 From: SrMouraSilva Date: Sat, 17 Feb 2018 17:36:46 -0300 Subject: [PATCH 02/24] #45 Test stage multiple requirements --- .travis.yml | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/.travis.yml b/.travis.yml index 11d0ab9..d5a46c8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,19 +14,9 @@ jobs: - stage: unit-test script: make test - stage: doc - script: make install-docs-requirements - - stage: deploy - script: ./deploy - -install: - - sudo apt-get update - - sudo apt-get install -y portaudio19-dev python-all-dev --no-install-recommends - - sudo apt-get install -y lilv-utils calf-plugins guitarix --no-install-recommends - - sudo apt-get install -y libavahi-compat-libdnssd1 --no-install-recommends - - pip3 install coveralls - - pip3 install git+https://github.com/depl0y/pybonjour-python3 - - pip3 install zeroconf - - python3 setup.py develop + script: + - make install-docs-requirements + - make test script: - lv2ls From ea7ce80dfb6ec2f04dbc47efaeb597733712b7e6 Mon Sep 17 00:00:00 2001 From: SrMouraSilva Date: Sat, 17 Feb 2018 17:39:42 -0300 Subject: [PATCH 03/24] #45 Test stage multiple requirements --- .travis.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index d5a46c8..357b6a8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,9 +18,5 @@ jobs: - make install-docs-requirements - make test -script: - - lv2ls - - coverage3 run --source=webservice wstest/config.py test - after_success: - 'bash <(curl -s https://codecov.io/bash)' From 4b1c127d0076200e942efe277efe373bc1dffd9e Mon Sep 17 00:00:00 2001 From: SrMouraSilva Date: Sat, 17 Feb 2018 17:50:20 -0300 Subject: [PATCH 04/24] #45 Makefile --- .travis.yml | 20 ++++++++++++++++---- makefile | 21 +++++++++++---------- 2 files changed, 27 insertions(+), 14 deletions(-) diff --git a/.travis.yml b/.travis.yml index 357b6a8..c589ada 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,11 +12,23 @@ sudo: required jobs: include: - stage: unit-test - script: make test + script: + - make install-tests-requirements + - make test + - 'bash <(curl -s https://codecov.io/bash)' - stage: doc script: - make install-docs-requirements - - make test + - make docs + +install: + - sudo apt-get update + - sudo apt-get install -y portaudio19-dev python-all-dev --no-install-recommends + - sudo apt-get install -y lilv-utils calf-plugins guitarix --no-install-recommends + - sudo apt-get install -y libavahi-compat-libdnssd1 --no-install-recommends + - pip3 install git+https://github.com/depl0y/pybonjour-python3 + - pip3 install zeroconf + - python3 setup.py develop -after_success: - - 'bash <(curl -s https://codecov.io/bash)' +script: + - lv2ls diff --git a/makefile b/makefile index ef9052d..e52e6f1 100644 --- a/makefile +++ b/makefile @@ -4,18 +4,18 @@ NORMAL=\033[0m default: help -FIXME clean: clean-pyc clean-test clean-build clean-docs +clean: clean-pyc clean-test clean-build clean-docs -FIXME clean-build: +clean-build: rm -rf .eggs rm -rf build rm -rf dist -FIXME clean-pyc: +clean-pyc: find . -name '*.pyc' -exec rm --force {} + find . -name '*.pyo' -exec rm --force {} + -FIXME clean-test: +clean-test: rm -rf .cache rm -f .coverage rm -rf htmlcov @@ -33,12 +33,13 @@ docs-see: docs install-docs-requirements: npm install -g aglio -FIXME install-tests-requirements: +install-tests-requirements: + pip3 install coveralls # For midi tests - https://github.com/x42/midifilter.lv2 - cd /tmp && git clone git://github.com/x42/midifilter.lv2.git && \ - cd midifilter.lv2 && \ - make && \ - sudo make install PREFIX=/usr + #cd /tmp && git clone git://github.com/x42/midifilter.lv2.git && \ + #cd midifilter.lv2 && \ + #make && \ + #sudo make install PREFIX=/usr run: @echo "Run option isn't created =)" @@ -46,7 +47,7 @@ run: test: clean-test coverage3 run --source=webservice wstest/config.py test -FIXME test-docs: +not-implemented-test-docs: python -m doctest *.rst -v python -m doctest docs/*/*.rst -v From 1016cd1c613d92d57a52dc3fccd7f0631e03e759 Mon Sep 17 00:00:00 2001 From: SrMouraSilva Date: Sat, 17 Feb 2018 18:17:02 -0300 Subject: [PATCH 05/24] #44 Connection new way --- webservice/handler/connection_handler.py | 8 ++++---- webservice/handler/pedalboard_data_handler.py | 2 +- webservice/webservice.py | 2 +- webservice/websocket/websocket_connection_observer.py | 2 -- wstest/handler/handler_test.py | 2 +- 5 files changed, 7 insertions(+), 9 deletions(-) diff --git a/webservice/handler/connection_handler.py b/webservice/handler/connection_handler.py index 7fa0231..c4fb6a8 100644 --- a/webservice/handler/connection_handler.py +++ b/webservice/handler/connection_handler.py @@ -33,9 +33,9 @@ def put(self, bank_index, pedalboard_index): bank = self._manager.banks[bank_index] pedalboard = bank.pedalboards[pedalboard_index] - connection = ConnectionReader(pedalboard, DeviceController.sys_effect).read(self.request_data) + output_port, input_port = ConnectionReader(pedalboard, DeviceController.sys_effect).read(self.request_data) with self.observer: - pedalboard.connections.append(connection) + pedalboard.connect(output_port, input_port) self.send(200) @@ -47,8 +47,8 @@ def post(self, bank_index, pedalboard_index): bank = self._manager.banks[bank_index] pedalboard = bank.pedalboards[pedalboard_index] - connection = ConnectionReader(pedalboard, DeviceController.sys_effect).read(self.request_data) + output_port, input_port = ConnectionReader(pedalboard, DeviceController.sys_effect).read(self.request_data) with self.observer: - pedalboard.connections.remove(connection) + pedalboard.disconnect(output_port, input_port) self.send(200) diff --git a/webservice/handler/pedalboard_data_handler.py b/webservice/handler/pedalboard_data_handler.py index 2e95865..c3f3280 100644 --- a/webservice/handler/pedalboard_data_handler.py +++ b/webservice/handler/pedalboard_data_handler.py @@ -50,7 +50,7 @@ def put(self, bank_index, pedalboard_index, key): pedalboard, UpdateType.UPDATED, index=pedalboard_index, - origin=bank_index, + origin=bank, old=pedalboard ) diff --git a/webservice/webservice.py b/webservice/webservice.py index a35466d..d505cb3 100644 --- a/webservice/webservice.py +++ b/webservice/webservice.py @@ -49,7 +49,7 @@ class WebService(Component): For more details, see http://pedalpi.github.io/WebService. """ - def __init__(self, application, port): + def __init__(self, application, port=3000): super().__init__(application) self.handlers = [] diff --git a/webservice/websocket/websocket_connection_observer.py b/webservice/websocket/websocket_connection_observer.py index 18d78e1..cd2e62c 100644 --- a/webservice/websocket/websocket_connection_observer.py +++ b/webservice/websocket/websocket_connection_observer.py @@ -14,8 +14,6 @@ from application.component.application_observer import ApplicationObserver -from webservice.websocket.web_socket_connections import WebSocketConnections - class WebSocketConnectionObserver(ApplicationObserver): diff --git a/wstest/handler/handler_test.py b/wstest/handler/handler_test.py index db36edf..e86ee9e 100644 --- a/wstest/handler/handler_test.py +++ b/wstest/handler/handler_test.py @@ -56,7 +56,7 @@ def default_bank_mock(self): pedalboard.append(reverb) pedalboard.append(reverb2) - reverb.outputs[0].connect(reverb2.inputs[0]) + pedalboard.connect(reverb.outputs[0], reverb2.inputs[0]) return bank From 7142ab7385c3d7e02cfe6044d6a005eb62c8584f Mon Sep 17 00:00:00 2001 From: SrMouraSilva Date: Sat, 17 Feb 2018 18:30:27 -0300 Subject: [PATCH 06/24] #44 Improve CI --- .travis.yml | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/.travis.yml b/.travis.yml index c589ada..a70b75e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,23 +4,9 @@ python: - "3.4" - "3.5" - "3.6" - - "3.7-dev" - - "nightly" sudo: required -jobs: - include: - - stage: unit-test - script: - - make install-tests-requirements - - make test - - 'bash <(curl -s https://codecov.io/bash)' - - stage: doc - script: - - make install-docs-requirements - - make docs - install: - sudo apt-get update - sudo apt-get install -y portaudio19-dev python-all-dev --no-install-recommends @@ -32,3 +18,20 @@ install: script: - lv2ls + + +jobs: + include: + - stage: unit-test + python: + - "3.4" + - "3.5" + - "3.6" + script: + - make install-tests-requirements + - make test + - 'bash <(curl -s https://codecov.io/bash)' + - stage: doc + script: + - make install-docs-requirements + - make docs From f8909329adabb2e9024ca16dabb114f7cc652045 Mon Sep 17 00:00:00 2001 From: SrMouraSilva Date: Fri, 9 Mar 2018 08:50:05 -0300 Subject: [PATCH 07/24] #44 #45 Improve build and CHANGELOG --- .travis.yml | 24 ++++++++---------------- CHANGES | 19 ++++++++++++++++--- docs/index.html | 2 +- makefile | 8 ++++++++ setup.py | 6 +++--- 5 files changed, 36 insertions(+), 23 deletions(-) diff --git a/.travis.yml b/.travis.yml index a70b75e..d91f4f5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,33 +4,25 @@ python: - "3.4" - "3.5" - "3.6" + - "3.7-dev" + - "nightly" sudo: required install: - - sudo apt-get update - - sudo apt-get install -y portaudio19-dev python-all-dev --no-install-recommends - - sudo apt-get install -y lilv-utils calf-plugins guitarix --no-install-recommends - - sudo apt-get install -y libavahi-compat-libdnssd1 --no-install-recommends - - pip3 install git+https://github.com/depl0y/pybonjour-python3 - - pip3 install zeroconf - - python3 setup.py develop + - make install-develop-requirements + - make install-tests-requirements + - pip3 install . script: - lv2ls + - make test +after_success: + - bash <(curl -s https://codecov.io/bash) jobs: include: - - stage: unit-test - python: - - "3.4" - - "3.5" - - "3.6" - script: - - make install-tests-requirements - - make test - - 'bash <(curl -s https://codecov.io/bash)' - stage: doc script: - make install-docs-requirements diff --git a/CHANGES b/CHANGES index 0138190..aae30b0 100644 --- a/CHANGES +++ b/CHANGES @@ -1,14 +1,27 @@ +Version 0.4.0 - released mm/dd/18 +================================= + + - Issue #45 - Add Makefile + - Issue #44 - Update libraries + + - PluginsManager v0.4.0? -> v0.7.0 + - Application v0.2.0 -> v0.4.0 + Version 0.3.0 - released 05/31/17 ================================= - - Issues #31 - Using logging instead print - - Issues #26 - Implemented secure close ([Application issue 29](https://github.com/PedalPi/Application/issues/29) version 0.3.0) - - Issues #27 - Rename zeroconf device name + + - Issue #31 - Using logging instead print + - Issue #26 - Implemented secure close ([Application issue 29](https://github.com/PedalPi/Application/issues/29) version 0.3.0) + - Issue #27 - Rename zeroconf device name - Improve Component Data documentation - Fix '#' problem when request plugin data - Issue #40 - Add support for plugins manager v0.5.0 and Application v0.3.0 + - Now using PluginsManager notification implementation (``with observer:``) + - Issue #37 - Banks swap -> Bank move Version 0.2.0 - released 05/13/17 ================================= + - Initial release diff --git a/docs/index.html b/docs/index.html index f0a0ea1..1528774 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1628,7 +1628,7 @@

Notification on_connection_updated } -

Generated by aglio on 28 May 2017