Reload command for remote, update, improved docs; Bump to 3.2b2

This commit is contained in:
Ivan Kravets
2016-11-12 00:28:49 +02:00
parent 5670b7af1f
commit 3d5fe149c3
20 changed files with 410 additions and 95 deletions

View File

@ -1,22 +0,0 @@
.. Copyright 2014-present PlatformIO <contact@platformio.org>
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

53
docs/core.rst Normal file
View File

@ -0,0 +1,53 @@
.. Copyright 2014-present PlatformIO <contact@platformio.org>
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 <cmd_device_monitor>`
* Integration components (:ref:`ide` and :ref:`ci`).
**PlatformIO Core** is written in `Python <https://www.python.org/downloads/>`_
and works on Windows, macOS, Linux, FreeBSD and *ARM*-based credit-card sized
computers (`Raspberry Pi <http://www.raspberrypi.org>`_,
`BeagleBone <http://beagleboard.org>`_,
`CubieBoard <http://cubieboard.org>`_).
**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

View File

@ -1,31 +0,0 @@
.. Copyright 2014-present PlatformIO <contact@platformio.org>
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 <http://platformio.org/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 <userguide>` tool (``pio``, ``platformio``)
`Install PlatformIO IDE <http://platformio.org/platformio-ide>`_.

View File

@ -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 <userguide>` tool (``pio``, ``platformio``)
* Built-in Terminal with :ref:`core` and CLI tool (``pio``, ``platformio``)
PlatformIO IDE is based on GitHub's `Atom <https://atom.io>`_ source
@ -49,14 +49,19 @@ It's built on top of `GitHub's Atom "hackable" text editor <https://atom.io>`_.
If you have already Atom installed, please install `PlatformIO IDE for Atom package <https://atom.io/packages/platformio-ide>`_.
.. 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 <https://www.python.org/downloads/>`_. 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

View File

@ -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

View File

@ -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

View File

@ -32,7 +32,7 @@ Deviot Plugin
We are glad to inform you about awesome Sublime Text plugin for IoT development
named `Deviot <https://github.com/gepd/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 <https://github.com/gepd/Deviot>`_ for the further installation
steps and documentation.

View File

@ -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 <ide/atom>
cli
core
.. toctree::
:caption: Configuration

View File

@ -14,10 +14,18 @@
Installation
============
.. include:: /ide/_platformio_ide_extra.rst
.. note::
**PlatformIO** is written in `Python <https://www.python.org/downloads/>`_ 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 <https://www.python.org/downloads/>`_
and works on Windows, macOS, Linux, FreeBSD and *ARM*-based credit-card sized
computers (`Raspberry Pi <http://www.raspberrypi.org>`_,
`BeagleBone <http://beagleboard.org>`_,
`CubieBoard <http://cubieboard.org>`_).
@ -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::

View File

@ -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 <atom_ide_quickstart>` 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 <https://github.com/platformio/platformio-examples/tree/develop>`_
* :ref:`userguide` for PlatformIO CLI commands
* :ref:`userguide` for :ref:`core` commands

View File

@ -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

View File

@ -0,0 +1,236 @@
.. Copyright 2014-present PlatformIO <contact@platformio.org>
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 <librarymanager>` 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

View File

@ -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

View File

@ -14,7 +14,7 @@
import sys
VERSION = (3, 2, "0b1")
VERSION = (3, 2, "0b2")
__version__ = ".".join([str(s) for s in VERSION])
__title__ = "platformio"

View File

@ -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

View File

@ -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)

View File

@ -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

View File

@ -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']]))

View File

@ -25,7 +25,8 @@ class PlatformioException(Exception):
class ReturnErrorCode(PlatformioException):
pass
MESSAGE = "{0}"
class MinitermException(PlatformioException):

View File

@ -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)