From 3d5fe149c331ef7eae7fd7d00f7d6e7180b607a6 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Sat, 12 Nov 2016 00:28:49 +0200 Subject: [PATCH] Reload command for remote, update, improved docs; Bump to 3.2b2 --- docs/cli.rst | 22 --- docs/core.rst | 53 ++++++ docs/ide/_platformio_ide_extra.rst | 31 ---- docs/ide/atom.rst | 19 ++- docs/ide/cloud9.rst | 4 +- docs/ide/codeanywhere.rst | 4 +- docs/ide/sublimetext.rst | 2 +- docs/index.rst | 4 +- docs/installation.rst | 20 ++- docs/quickstart.rst | 12 +- docs/userguide/remote/cmd_agent.rst | 35 ++++ docs/userguide/remote/cmd_update.rst | 236 +++++++++++++++++++++++++++ docs/userguide/remote/index.rst | 4 + platformio/__init__.py | 2 +- platformio/__main__.py | 2 +- platformio/commands/remote.py | 16 ++ platformio/commands/run.py | 2 +- platformio/commands/upgrade.py | 2 +- platformio/exception.py | 3 +- platformio/pioplus.py | 32 +++- 20 files changed, 410 insertions(+), 95 deletions(-) delete mode 100644 docs/cli.rst create mode 100644 docs/core.rst delete mode 100644 docs/ide/_platformio_ide_extra.rst create mode 100644 docs/userguide/remote/cmd_update.rst diff --git a/docs/cli.rst b/docs/cli.rst deleted file mode 100644 index f740401f..00000000 --- a/docs/cli.rst +++ /dev/null @@ -1,22 +0,0 @@ -.. Copyright 2014-present PlatformIO - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -.. _cli: - -PlatformIO CLI -============== - -.. toctree:: - :maxdepth: 2 - - installation - quickstart - userguide/index diff --git a/docs/core.rst b/docs/core.rst new file mode 100644 index 00000000..22dfc2f9 --- /dev/null +++ b/docs/core.rst @@ -0,0 +1,53 @@ +.. Copyright 2014-present PlatformIO + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +.. _core: + +PlatformIO Core +=============== + +**PlatformIO Core** is a heart of whole PlatformIO ecosystem and consists of + +* Multi-platform Build System +* Development platform and package managers +* :ref:`librarymanager` +* :ref:`ldf` +* :ref:`Serial Port Monitor ` +* Integration components (:ref:`ide` and :ref:`ci`). + +**PlatformIO Core** is written in `Python `_ +and works on Windows, macOS, Linux, FreeBSD and *ARM*-based credit-card sized +computers (`Raspberry Pi `_, +`BeagleBone `_, +`CubieBoard `_). + + +**PlatformIO Core** provides rich and documented Command Line Interface (CLI). +The other PlatformIO-based software and IDEs are based on +**PlatformIO Core CLI**, such as :ref:`ide_atom`. In other words, they wrap +**PlatformIO Core** with own GUI. + +.. note:: + + Please note that you do not need to install **PlatformIO Core** if you + are going to use :ref:`ide_atom`. **PlatformIO Core** is built into + PlatformIO IDE and you will be able to use it within PlatformIO IDE Terminal. + + Also, PlatformIO IDE allows to install :ref:`core` Shell Commands + (``pio``, ``platformio``) globally to your system via + ``Menu: PlatformIO > Install Shell Commands``. + +.. toctree:: + :maxdepth: 2 + + installation + quickstart + userguide/index diff --git a/docs/ide/_platformio_ide_extra.rst b/docs/ide/_platformio_ide_extra.rst deleted file mode 100644 index 3b30d1d4..00000000 --- a/docs/ide/_platformio_ide_extra.rst +++ /dev/null @@ -1,31 +0,0 @@ -.. Copyright 2014-present PlatformIO - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -.. note:: - We are proud to present our official `PlatformIO IDE `_ - - The next-generation integrated development environment for IoT. - - * Cross-platform build system without external dependencies to the OS software: - - - 300+ embedded boards - - 15+ development platforms - - 10+ frameworks - - * C/C++ Intelligent code completion - * C/C++ Smart code linter for super-fast coding - * Library Manager for the hundreds popular libraries - * Multi-projects workflow with multiple panes - * Multiple panes - * Themes support with dark and light colors - * Serial Port Monitor - * Built-in Terminal with :ref:`PlatformIO CLI ` tool (``pio``, ``platformio``) - - `Install PlatformIO IDE `_. diff --git a/docs/ide/atom.rst b/docs/ide/atom.rst index e5d0de98..a33cf0ee 100644 --- a/docs/ide/atom.rst +++ b/docs/ide/atom.rst @@ -28,7 +28,7 @@ PlatformIO IDE is the next-generation integrated development environment for IoT * Multi-projects workflow with multiple panes * Themes support with dark and light colors * Serial Port Monitor -* Built-in Terminal with :ref:`PlatformIO CLI ` tool (``pio``, ``platformio``) +* Built-in Terminal with :ref:`core` and CLI tool (``pio``, ``platformio``) PlatformIO IDE is based on GitHub's `Atom `_ source @@ -49,14 +49,19 @@ It's built on top of `GitHub's Atom "hackable" text editor `_. If you have already Atom installed, please install `PlatformIO IDE for Atom package `_. .. note:: - You don't need to install PlatformIO CLI separately to system. - PlatformIO CLI is built into PlatformIO IDE and you will be able to use it - within PlatformIO IDE Terminal. + + Please note that you do not need to install :ref:`core` if you + are going to use :ref:`ide_atom`. :ref:`core` is built into + PlatformIO IDE and you will be able to use it within PlatformIO IDE Terminal. + + Also, PlatformIO IDE allows to install :ref:`core` Shell Commands + (``pio``, ``platformio``) globally to your system via + ``Menu: PlatformIO > Install Shell Commands``. 1. Python Interpreter ~~~~~~~~~~~~~~~~~~~~~ -PlatformIO IDE is based on PlatformIO CLI which is written in +PlatformIO IDE is based on :ref:`core` which is written in `Python `_. Python is installed by default on the all popular OS except Windows. @@ -131,7 +136,7 @@ Launch After installation, you launch PlatformIO IDE by opening Atom. Once Atom is open, PlatformIO IDE auto installer will continue to install dependent packages -and PlatformIO CLI. Please be patient and let the installation complete. In the +and :ref:`core`. Please be patient and let the installation complete. In the final result PlatformIO IDE will ask you to reload Atom window to apply installed components. Please click on ``Reload Now``. After it PlatformIO IDE is ready for using. Happy coding! @@ -237,7 +242,7 @@ And select desired target: .. image:: ../_static/ide-atom-platformio-quick-start-10.png :target: http://docs.platformio.org/en/stable/_images/ide-atom-platformio-quick-start-10.png -It provides you fast access to all set of powerful PlatformIO CLI commands: +It provides you fast access to all set of powerful :ref:`core` CLI commands: .. image:: ../_static/ide-atom-platformio-quick-start-11.png :target: http://docs.platformio.org/en/stable/_images/ide-atom-platformio-quick-start-11.png diff --git a/docs/ide/cloud9.rst b/docs/ide/cloud9.rst index 81607ae5..108060e0 100644 --- a/docs/ide/cloud9.rst +++ b/docs/ide/cloud9.rst @@ -46,7 +46,7 @@ Integration .. image:: ../_static/ide/cloud9/ide-cloud9-new-workspace.png -3. Install PlatformIO CLI using Cloud IDE Terminal. Paste a next command +3. Install :ref:`core` using Cloud IDE Terminal. Paste a next command .. code-block:: bash @@ -103,7 +103,7 @@ Let's create our first PlatformIO-based Cloud9 Project .. image:: ../_static/ide/cloud9/ide-cloud9-init-project.png -3. If you prefer to work with PlatformIO CLI, then you can process project +3. If you prefer to work with :ref:`core` CLI, then you can process project using Cloud IDE Terminal and the next commands: * :ref:`cmd_run` - build project diff --git a/docs/ide/codeanywhere.rst b/docs/ide/codeanywhere.rst index d16baeff..534b3b3b 100644 --- a/docs/ide/codeanywhere.rst +++ b/docs/ide/codeanywhere.rst @@ -55,7 +55,7 @@ Integration .. image:: ../_static/ide/codeanywhere/ide-codeanywhere-connection-wizard.png 3. Open **SSH-Terminal** tab (right click on - ``Container (PlatformIO) > SSH Terminal``) and install PlatformIO CLI using + ``Container (PlatformIO) > SSH Terminal``) and install :ref:`core` using a next command .. code-block:: bash @@ -116,7 +116,7 @@ Let's create our first PlatformIO-based Codeanywhere Project .. image:: ../_static/ide/codeanywhere/ide-codeanywhere-init-project.png -3. If you prefer to work with PlatformIO CLI, then you can process project +3. If you prefer to work with :ref:`core` CLI, then you can process project using Cloud IDE SSH Terminal and the next commands: * :ref:`cmd_run` - build project diff --git a/docs/ide/sublimetext.rst b/docs/ide/sublimetext.rst index 3589287d..3c4f0ba0 100644 --- a/docs/ide/sublimetext.rst +++ b/docs/ide/sublimetext.rst @@ -32,7 +32,7 @@ Deviot Plugin We are glad to inform you about awesome Sublime Text plugin for IoT development named `Deviot `_. It is based on -PlatformIO CLI and will automatically install it for you. Please visit `official +:ref:`core` and will automatically install it for you. Please visit `official Deviot page `_ for the further installation steps and documentation. diff --git a/docs/index.rst b/docs/index.rst index 545ad8a6..f10ab9a6 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -18,7 +18,7 @@ integration. Arduino, ESP8266 and ARM mbed compatible.** * **PlatformIO IDE** - The next-generation integrated development environment for IoT. C/C++ Intelligent Code Completion and Smart Code Linter for the super-fast coding. Multi-projects workflow with Multiple Panes. Themes Support with dark and light colors. - Built-in Terminal with PlatformIO CLI tool and support for the powerful Serial Port Monitor. + Built-in Terminal with :ref:`core` and support for the powerful Serial Port Monitor. All advanced instruments without leaving your favorite development environment. * **Development Platforms** - Embedded and Desktop development platforms with pre-built toolchains, debuggers, uploaders and frameworks which work under @@ -94,7 +94,7 @@ Contents :maxdepth: 2 PlatformIO IDE - cli + core .. toctree:: :caption: Configuration diff --git a/docs/installation.rst b/docs/installation.rst index 193d84f4..e61f78b2 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -14,10 +14,18 @@ Installation ============ -.. include:: /ide/_platformio_ide_extra.rst +.. note:: -**PlatformIO** is written in `Python `_ and -works on Mac OS X, Linux, Windows OS and *ARM*-based credit-card sized + Please note that you do not need to install **PlatformIO Core** if you + are going to use :ref:`ide_atom`. **PlatformIO Core** is built into + PlatformIO IDE and you will be able to use it within PlatformIO IDE Terminal. + + Also, PlatformIO IDE allows to install :ref:`core` Shell Commands + (``pio``, ``platformio``) globally to your system via + ``Menu: PlatformIO > Install Shell Commands``. + +**PlatformIO Core** is written in `Python `_ +and works on Windows, macOS, Linux, FreeBSD and *ARM*-based credit-card sized computers (`Raspberry Pi `_, `BeagleBone `_, `CubieBoard `_). @@ -68,12 +76,6 @@ System requirements Installation Methods -------------------- -.. note:: - You don't need to install PlatformIO CLI if you are going to use - :ref:`ide_atom`. PlatformIO CLI is built into PlatformIO IDE and you will be - able to use it within PlatformIO IDE Terminal. - - Please *choose ONE of* the following methods: .. contents:: diff --git a/docs/quickstart.rst b/docs/quickstart.rst index a1859629..6c10d3fa 100644 --- a/docs/quickstart.rst +++ b/docs/quickstart.rst @@ -14,11 +14,7 @@ Quick Start =========== -.. note:: - If you are looking for a Quick Start for PlatformIO IDE please follow to - :ref:`PlatformIO IDE Quick Start ` page. - -This tutorial introduces you to the basics of PlatformIO Command Line Interface +This tutorial introduces you to the basics of :ref:`core` Command Line Interface (CLI) workflow and shows you a creation process of a simple cross-platform “Blink” Project. After finishing you will have a general understanding of how to work with the multiple development platforms and embedded boards. @@ -26,7 +22,7 @@ to work with the multiple development platforms and embedded boards. Setting Up the Project ---------------------- -PlatformIO CLI provides special :ref:`cmd_init` command for configuring your projects. +:ref:`core` provides special :ref:`cmd_init` command for configuring your projects. It allows to initialize new empty project or update existing with the new data. What is more, :ref:`cmd_init` can be used for :ref:`ide`. It means that you will @@ -220,7 +216,7 @@ The final Project structure: Process Project --------------- -PlatformIO CLI provides special :ref:`cmd_run` command to process project. If +:ref:`core` provides special :ref:`cmd_run` command to process project. If you call it without any arguments, PlatformIO Build System will process all project environments (which were created per each board specified above). Here are a few useful commands: @@ -246,4 +242,4 @@ Further Reading --------------- * `Project examples `_ -* :ref:`userguide` for PlatformIO CLI commands +* :ref:`userguide` for :ref:`core` commands diff --git a/docs/userguide/remote/cmd_agent.rst b/docs/userguide/remote/cmd_agent.rst index 0257fa46..cfab1a2e 100644 --- a/docs/userguide/remote/cmd_agent.rst +++ b/docs/userguide/remote/cmd_agent.rst @@ -100,3 +100,38 @@ Share your agent/devices with other PlatformIO developers who have The valid value for ``--share`` option is E-Mail address that was used for :ref:`cmd_account_register` command. + +------------ + +platformio remote agent reload +------------------------------ + +Usage +~~~~~ + +.. code:: + + platformio remote agent reload + + # reload specified PIO Remote Agents + platformio remote --agent NAME reload + + +Description +~~~~~~~~~~~ + +Allows gracefully reload one or more :ref:`cmd_remote_agent` 's. + +Example +~~~~~~~ + +.. code:: + + > platformio remote agent list + + PlatformIO Plus (https://pioplus.com) + + innomac.local + ------------- + ID: 98853d93.....77375e7 + Reloaded: 2016-11-11 23:33:32 diff --git a/docs/userguide/remote/cmd_update.rst b/docs/userguide/remote/cmd_update.rst new file mode 100644 index 00000000..d61ac245 --- /dev/null +++ b/docs/userguide/remote/cmd_update.rst @@ -0,0 +1,236 @@ +.. Copyright 2014-present PlatformIO + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +.. _cmd_remote_update: + +platformio remote update +======================== + +.. contents:: + +Usage +----- + +.. code-block:: bash + + platformio remote update [OPTIONS] + + # start update process on the specified agents/machines + platformio remote --agent NAME update [OPTIONS] + +Description +----------- + +Check or update installed :ref:`platforms` and global +:ref:`Libraries ` on the remote machine. + +Options +------- + +.. program:: platformio remote update + +.. option:: + -c, --only-check + +Do not update, only check for new version + + +Examples +-------- + +.. code:: + + > platformio remote update + + PlatformIO Plus (https://pioplus.com) + + Platform Manager + ================ + Platform timsp430 + -------- + Updating timsp430 @ 0.0.0: [Up-to-date] + Updating toolchain-timsp430 @ 1.40603.0: [Up-to-date] + Updating framework-energiamsp430 @ 1.17.0: [Up-to-date] + Updating framework-arduinomsp430 @ 1.10601.0: [Up-to-date] + Updating tool-scons @ 2.4.1: [Up-to-date] + + Platform freescalekinetis + -------- + Updating freescalekinetis @ 0.0.0: [Up-to-date] + Updating framework-mbed @ 1.121.1: [Up-to-date] + Updating toolchain-gccarmnoneeabi @ 1.40804.0: [Up-to-date] + Updating tool-scons @ 2.4.1: [Up-to-date] + + Platform ststm32 + -------- + Updating ststm32 @ 0.0.0: [Up-to-date] + Updating framework-libopencm3 @ 1.1.0: [Up-to-date] + Updating toolchain-gccarmnoneeabi @ 1.40804.0: [Up-to-date] + Updating tool-stlink @ 1.10200.0: [Up-to-date] + Updating framework-spl @ 1.10201.0: [Up-to-date] + Updating framework-cmsis @ 1.40300.0: [Up-to-date] + Updating framework-mbed @ 1.121.1: [Up-to-date] + Updating tool-scons @ 2.4.1: [Up-to-date] + + Platform lattice_ice40 + -------- + Updating lattice_ice40 @ 0.0.0: [Up-to-date] + Updating toolchain-icestorm @ 1.7.0: [Up-to-date] + Updating tool-scons @ 2.4.1: [Up-to-date] + + Platform atmelavr + -------- + Updating atmelavr @ 0.0.0: [Up-to-date] + Updating framework-arduinoavr @ 1.10608.1: [Up-to-date] + Updating tool-avrdude @ 1.60001.1: [Up-to-date] + Updating toolchain-atmelavr @ 1.40801.0: [Up-to-date] + Updating tool-scons @ 2.4.1: [Up-to-date] + + Platform espressif8266 + -------- + Updating espressif8266 @ 0.0.0: [Up-to-date] + Updating tool-scons @ 2.4.1: [Up-to-date] + Updating toolchain-xtensa @ 1.40802.0: [Up-to-date] + Updating tool-esptool @ 1.409.0: [Up-to-date] + Updating tool-mkspiffs @ 1.102.0: [Up-to-date] + Updating framework-arduinoespressif8266 @ 1.20300.0: [Up-to-date] + Updating sdk-esp8266 @ 1.10502.0: [Up-to-date] + + Platform linux_x86_64 + -------- + Updating linux_x86_64 @ 0.0.0: [Up-to-date] + Updating toolchain-gcclinux64 @ 1.40801.0: [Up-to-date] + Updating tool-scons @ 2.4.1: [Up-to-date] + + Platform windows_x86 + -------- + Updating windows_x86 @ 0.0.0: [Up-to-date] + Updating toolchain-gccmingw32 @ 1.40800.0: [Up-to-date] + Updating tool-scons @ 2.4.1: [Up-to-date] + + Platform teensy + -------- + Updating teensy @ 0.0.0: [Up-to-date] + Updating framework-arduinoteensy @ 1.128.0: [Up-to-date] + Updating tool-teensy @ 1.1.0: [Up-to-date] + Updating framework-mbed @ 1.121.1: [Up-to-date] + Updating tool-scons @ 2.4.1: [Up-to-date] + Updating toolchain-atmelavr @ 1.40801.0: [Up-to-date] + Updating toolchain-gccarmnoneeabi @ 1.40804.0: [Up-to-date] + + Platform nordicnrf51 + -------- + Updating nordicnrf51 @ 0.0.0: [Up-to-date] + Updating toolchain-gccarmnoneeabi @ 1.40804.0: [Up-to-date] + Updating framework-arduinonordicnrf51 @ 1.20302.0: [Up-to-date] + Updating framework-mbed @ 1.121.1: [Up-to-date] + Updating tool-scons @ 2.4.1: [Up-to-date] + + Platform titiva + -------- + Updating titiva @ 0.0.0: [Up-to-date] + Updating framework-libopencm3 @ 1.1.0: [Up-to-date] + Updating toolchain-gccarmnoneeabi @ 1.40804.0: [Up-to-date] + Updating framework-energiativa @ 1.17.0: [Up-to-date] + Updating tool-scons @ 2.4.1: [Up-to-date] + + Platform atmelsam + -------- + Updating atmelsam @ 0.0.0: [Up-to-date] + Updating toolchain-gccarmnoneeabi @ 1.40804.0: [Up-to-date] + Updating tool-openocd @ 1.900.0: [Up-to-date] + Updating framework-mbed @ 1.121.1: [Up-to-date] + Updating tool-scons @ 2.4.1: [Up-to-date] + Updating tool-avrdude @ 1.60001.1: [Up-to-date] + Updating tool-bossac @ 1.10601.0: [Up-to-date] + + Platform siliconlabsefm32 + -------- + Updating siliconlabsefm32 @ 0.0.0: [Up-to-date] + Updating framework-mbed @ 1.121.1: [Up-to-date] + Updating toolchain-gccarmnoneeabi @ 1.40804.0: [Up-to-date] + Updating tool-scons @ 2.4.1: [Up-to-date] + + Platform microchippic32 + -------- + Updating microchippic32 @ 0.0.0: [Up-to-date] + Updating framework-arduinomicrochippic32 @ 1.10201.0: [Up-to-date] + Updating toolchain-microchippic32 @ 1.40803.0: [Up-to-date] + Updating tool-pic32prog @ 1.200200.0: [Up-to-date] + Updating tool-scons @ 2.4.1: [Up-to-date] + + Platform linux_i686 + -------- + Updating linux_i686 @ 0.0.0: [Up-to-date] + Updating toolchain-gcclinux32 @ 1.40801.0: [Up-to-date] + Updating tool-scons @ 2.4.1: [Up-to-date] + + Platform intel_arc32 + -------- + Updating intel_arc32 @ 0.0.0: [Up-to-date] + Updating framework-arduinointel @ 1.10006.0: [Up-to-date] + Updating tool-arduino101load @ 1.124.0: [Up-to-date] + Updating toolchain-intelarc32 @ 1.40805.0: [Up-to-date] + Updating tool-scons @ 2.4.1: [Up-to-date] + + Platform nxplpc + -------- + Updating nxplpc @ 0.0.0: [Up-to-date] + Updating framework-mbed @ 1.121.1: [Up-to-date] + Updating toolchain-gccarmnoneeabi @ 1.40804.0: [Up-to-date] + Updating tool-scons @ 2.4.1: [Up-to-date] + + Platform linux_arm + -------- + Updating linux_arm @ 0.0.0: [Up-to-date] + Updating toolchain-gccarmlinuxgnueabi @ 1.40802.0: [Up-to-date] + Updating tool-scons @ 2.4.1: [Up-to-date] + + Platform native + -------- + Updating native @ 0.0.0: [Up-to-date] + Updating tool-scons @ 2.4.1: [Up-to-date] + + + Library Manager + =============== + Updating Adafruit-GFX @ 334e815bc1: [Up-to-date] + Updating Adafruit-ST7735 @ d53d4bf03a: [Up-to-date] + Updating Adafruit-DHT @ 09344416d2: [Up-to-date] + Updating Adafruit-Unified-Sensor @ f2af6f4efc: [Up-to-date] + Updating ESP8266_SSD1306 @ 3.2.3: [Up-to-date] + Updating EngduinoMagnetometer @ 3.1.0: [Up-to-date] + Updating IRremote @ 2.2.1: [Up-to-date] + Updating Json @ 5.6.4: [Up-to-date] + Updating MODSERIAL @ d8422efe47: [Up-to-date] + Updating PJON @ 1fb26fd: [Checking] + git version 2.7.4 (Apple Git-66) + Already up-to-date. + Updating Servo @ 36b69a7ced07: [Checking] + Mercurial Distributed SCM (version 3.8.4) + (see https://mercurial-scm.org for more information) + + Copyright (C) 2005-2016 Matt Mackall and others + This is free software; see the source for copying conditions. There is NO + warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + pulling from https://developer.mbed.org/users/simon/code/Servo/ + searching for changes + no changes found + Updating TextLCD @ 308d188a2d3a: [Checking] + Mercurial Distributed SCM (version 3.8.4) + (see https://mercurial-scm.org for more information) + + Copyright (C) 2005-2016 Matt Mackall and others + This is free software; see the source for copying conditions. There is NO + warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + pulling from https://developer.mbed.org/users/simon/code/TextLCD/ + searching for changes + no changes found diff --git a/docs/userguide/remote/index.rst b/docs/userguide/remote/index.rst index 97ce89d1..832aafc8 100644 --- a/docs/userguide/remote/index.rst +++ b/docs/userguide/remote/index.rst @@ -38,6 +38,9 @@ To print all available commands and options use: platformio remote --help platformio remote COMMAND --help + # run command on the specified PIO Remote Agents + platformio remote --agent NAME_1 --agent NAME_N COMMAND + .. toctree:: :maxdepth: 2 @@ -46,3 +49,4 @@ To print all available commands and options use: cmd_device cmd_run cmd_test + cmd_update diff --git a/platformio/__init__.py b/platformio/__init__.py index b2e6f182..0fe17fe7 100644 --- a/platformio/__init__.py +++ b/platformio/__init__.py @@ -14,7 +14,7 @@ import sys -VERSION = (3, 2, "0b1") +VERSION = (3, 2, "0b2") __version__ = ".".join([str(s) for s in VERSION]) __title__ = "platformio" diff --git a/platformio/__main__.py b/platformio/__main__.py index 05486bf0..fe9a7d7f 100644 --- a/platformio/__main__.py +++ b/platformio/__main__.py @@ -129,7 +129,7 @@ An unexpected error occurred. Further steps: ============================================================ """ click.secho(error_str, fg="red", err=True) - return 1 + return int(str(e)) if str(e).isdigit() else 1 return 0 diff --git a/platformio/commands/remote.py b/platformio/commands/remote.py index 94fadc6a..4512bf3e 100644 --- a/platformio/commands/remote.py +++ b/platformio/commands/remote.py @@ -46,11 +46,27 @@ def remote_agent_start(**kwargs): pioplus_call(sys.argv[1:]) +@remote_agent.command("reload", short_help="Reload agents") +def remote_agent_reload(): + pioplus_call(sys.argv[1:]) + + @remote_agent.command("list", short_help="List active agents") def remote_agent_list(): pioplus_call(sys.argv[1:]) +@cli.command( + "update", short_help="Update installed Platforms, Packages and Libraries") +@click.option( + "-c", + "--only-check", + is_flag=True, + help="Do not update, only check for new version") +def remote_update(only_check): + pioplus_call(sys.argv[1:]) + + @cli.command("run", short_help="Process project environments remotely") @click.option("-e", "--environment", multiple=True) @click.option("-t", "--target", multiple=True) diff --git a/platformio/commands/run.py b/platformio/commands/run.py index ead610a9..b6e04808 100644 --- a/platformio/commands/run.py +++ b/platformio/commands/run.py @@ -113,7 +113,7 @@ def cli(ctx, environment, target, upload_port, project_dir, silent, verbose, print_summary(results, start_time) if any([r is False for r in results.values()]): - raise exception.ReturnErrorCode() + raise exception.ReturnErrorCode(1) return True diff --git a/platformio/commands/upgrade.py b/platformio/commands/upgrade.py index 33a30bc0..ad92ba99 100644 --- a/platformio/commands/upgrade.py +++ b/platformio/commands/upgrade.py @@ -81,7 +81,7 @@ WARNING! Don't use `sudo` for the rest PlatformIO commands. """, fg="yellow", err=True) - raise exception.ReturnErrorCode() + raise exception.ReturnErrorCode(1) else: raise exception.UpgradeError("\n".join( [str(cmd), r['out'], r['err']])) diff --git a/platformio/exception.py b/platformio/exception.py index 5d5be430..8a5489f3 100644 --- a/platformio/exception.py +++ b/platformio/exception.py @@ -25,7 +25,8 @@ class PlatformioException(Exception): class ReturnErrorCode(PlatformioException): - pass + + MESSAGE = "{0}" class MinitermException(PlatformioException): diff --git a/platformio/pioplus.py b/platformio/pioplus.py index fc215057..8bda202c 100644 --- a/platformio/pioplus.py +++ b/platformio/pioplus.py @@ -23,14 +23,16 @@ from platformio.managers.package import PackageManager PACKAGE_DEPS = { "pysite": { "name": "pysite-pioplus", - "requirements": "^0.2.0" + "requirements": ">=0.2.0,<2" }, "tool": { "name": "tool-pioplus", - "requirements": "^0.4.0" + "requirements": ">=0.5.0,<2" } } +AUTO_UPDATES_MAX = 100 + class PioPlusPackageManager(PackageManager): @@ -39,8 +41,6 @@ class PioPlusPackageManager(PackageManager): self, join(util.get_home_dir(), "packages"), [ "https://dl.bintray.com/platformio/dl-packages/manifest.json", - "https://sourceforge.net/projects/platformio-storage/files/" - "packages/manifest.json/download", "https://dl.platformio.org/packages/manifest.json" ]) @@ -71,5 +71,25 @@ def pioplus_call(args, **kwargs): os.environ['PYTHONPYSITEDIR'] = pm.get_package_dir( PACKAGE_DEPS['pysite']['name'], PACKAGE_DEPS['pysite']['requirements']) util.copy_pythonpath_to_osenv() - if subprocess.call([pioplus_path] + args, **kwargs) != 0: - raise exception.ReturnErrorCode() + code = subprocess.call([pioplus_path] + args, **kwargs) + + # handle remote update request + if code == 13: + count_attr = "_update_count" + try: + count_value = getattr(pioplus_call, count_attr) + except AttributeError: + count_value = 0 + setattr(pioplus_call, count_attr, 1) + count_value += 1 + setattr(pioplus_call, count_attr, count_value) + if count_value < AUTO_UPDATES_MAX: + pioplus_update() + return pioplus_call(args, **kwargs) + + # handle reload request + elif code == 14: + return pioplus_call(args, **kwargs) + + if code != 0: + raise exception.ReturnErrorCode(1)