mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-31 18:44:27 +02:00
Merge branch 'release/v2.2.2'
This commit is contained in:
20
HISTORY.rst
20
HISTORY.rst
@@ -1,14 +1,30 @@
|
|||||||
Release History
|
Release History
|
||||||
===============
|
===============
|
||||||
|
|
||||||
2.2.1 (2015-??-??)
|
2.2.2 (2015-07-30)
|
||||||
|
------------------
|
||||||
|
|
||||||
|
* Integration with `Atom IDE <http://docs.platformio.org/en/latest/ide/atom.html>`__
|
||||||
|
* Support for off-line/unpublished/private libraries
|
||||||
|
(`issue #260 <https://github.com/platformio/platformio/issues/260>`_)
|
||||||
|
* Disable project auto-clean while building/uploading firmware using
|
||||||
|
`platformio run --disable-auto-clean <http://docs.platformio.org/en/latest/userguide/cmd_run.html#cmdoption--disable-auto-clean>`_ option
|
||||||
|
(`issue #255 <https://github.com/platformio/platformio/issues/255>`_)
|
||||||
|
* Show internal errors from "Miniterm" using `platformio serialports monitor <http://docs.platformio.org/en/latest/userguide/cmd_serialports.html#platformio-serialports-monitor>`__ command
|
||||||
|
(`issue #257 <https://github.com/platformio/platformio/issues/257>`_)
|
||||||
|
* Fixed `platformio serialports monitor --help <http://docs.platformio.org/en/latest/userguide/cmd_serialports.html#platformio-serialports-monitor>`__ information with HEX char for hotkeys
|
||||||
|
(`issue #253 <https://github.com/platformio/platformio/issues/253>`_)
|
||||||
|
* Handle "OSError: [Errno 13] Permission denied" for PlatformIO installer script
|
||||||
|
(`issue #254 <https://github.com/platformio/platformio/issues/254>`_)
|
||||||
|
|
||||||
|
2.2.1 (2015-07-17)
|
||||||
------------------
|
------------------
|
||||||
|
|
||||||
* Project generator for `CLion IDE <http://docs.platformio.org/en/latest/ide/clion.html>`__
|
* Project generator for `CLion IDE <http://docs.platformio.org/en/latest/ide/clion.html>`__
|
||||||
(`issue #132 <https://github.com/platformio/platformio/issues/132>`_)
|
(`issue #132 <https://github.com/platformio/platformio/issues/132>`_)
|
||||||
* Updated ``tool-bossac`` package to 1.5 version for `atmelsam <http://docs.platformio.org/en/latest/platforms/atmelsam.html>`__ platform
|
* Updated ``tool-bossac`` package to 1.5 version for `atmelsam <http://docs.platformio.org/en/latest/platforms/atmelsam.html>`__ platform
|
||||||
* Updated ``sdk-esp8266`` package for `espressif <http://docs.platformio.org/en/latest/platforms/espressif.html>`__ platform
|
|
||||||
(`issue #251 <https://github.com/platformio/platformio/issues/251>`_)
|
(`issue #251 <https://github.com/platformio/platformio/issues/251>`_)
|
||||||
|
* Updated ``sdk-esp8266`` package for `espressif <http://docs.platformio.org/en/latest/platforms/espressif.html>`__ platform
|
||||||
* Fixed incorrect arguments handling for `platformio serialports monitor <http://docs.platformio.org/en/latest/userguide/cmd_serialports.html#platformio-serialports-monitor>`_ command
|
* Fixed incorrect arguments handling for `platformio serialports monitor <http://docs.platformio.org/en/latest/userguide/cmd_serialports.html#platformio-serialports-monitor>`_ command
|
||||||
(`issue #248 <https://github.com/platformio/platformio/issues/248>`_)
|
(`issue #248 <https://github.com/platformio/platformio/issues/248>`_)
|
||||||
|
|
||||||
|
@@ -7,9 +7,6 @@ PlatformIO
|
|||||||
.. image:: https://ci.appveyor.com/api/projects/status/dku0h2rutfj0ctls/branch/develop?svg=true
|
.. image:: https://ci.appveyor.com/api/projects/status/dku0h2rutfj0ctls/branch/develop?svg=true
|
||||||
:target: https://ci.appveyor.com/project/ivankravets/platformio
|
:target: https://ci.appveyor.com/project/ivankravets/platformio
|
||||||
:alt: AppVeyor.CI Build Status
|
:alt: AppVeyor.CI Build Status
|
||||||
.. image:: https://api.shippable.com/projects/555b0ceeedd7f2c052f3c2d0/badge?branchName=develop
|
|
||||||
:target: https://app.shippable.com/projects/555b0ceeedd7f2c052f3c2d0
|
|
||||||
:alt: Shippable Build Status
|
|
||||||
.. image:: https://circleci.com/gh/platformio/platformio/tree/develop.svg?style=svg
|
.. image:: https://circleci.com/gh/platformio/platformio/tree/develop.svg?style=svg
|
||||||
:target: https://circleci.com/gh/platformio/platformio/tree/develop
|
:target: https://circleci.com/gh/platformio/platformio/tree/develop
|
||||||
:alt: Circle.CI Build Status
|
:alt: Circle.CI Build Status
|
||||||
|
BIN
docs/_static/ide-platformio-atom-1.gif
vendored
Normal file
BIN
docs/_static/ide-platformio-atom-1.gif
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 237 KiB |
BIN
docs/_static/ide-platformio-atom-2.gif
vendored
Normal file
BIN
docs/_static/ide-platformio-atom-2.gif
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 157 KiB |
@@ -9,6 +9,7 @@ Articles about us
|
|||||||
|
|
||||||
Here are recent articles about PlatformIO:
|
Here are recent articles about PlatformIO:
|
||||||
|
|
||||||
|
* Jul 20, 2015 - **Eli Fatsi** - `Arduino Development in Atom Editor <http://viget.com/extend/arduino-development-in-atom-editor>`_
|
||||||
* Jun 02, 2015 - **Alejandro Guirao Rodriguez** - `Discovering PlatformIO: The RaspberryPi / Arduino combo kit is a winner option when prototyping an IoT-style project <http://lekum.org/posts/discovering-platformio.html>`_
|
* Jun 02, 2015 - **Alejandro Guirao Rodriguez** - `Discovering PlatformIO: The RaspberryPi / Arduino combo kit is a winner option when prototyping an IoT-style project <http://lekum.org/posts/discovering-platformio.html>`_
|
||||||
* May 11, 2015 - **IT Hare** - `From Web Developer to Embedded One: Interview with Ivan Kravets, The Guy Behind PlatformIO. Part II <http://ithare.com/from-web-developer-to-embedded-one-interview-with-ivan-kravets-the-guy-behind-platformio-part-ii/>`_
|
* May 11, 2015 - **IT Hare** - `From Web Developer to Embedded One: Interview with Ivan Kravets, The Guy Behind PlatformIO. Part II <http://ithare.com/from-web-developer-to-embedded-one-interview-with-ivan-kravets-the-guy-behind-platformio-part-ii/>`_
|
||||||
* May 4, 2015 - **IT Hare** - `From Web Developer to Embedded One: Interview with Ivan Kravets, The Guy Behind PlatformIO. Part I <http://ithare.com/from-web-development-to-embedded-one-interview-with-ivan-kravets-the-guy-behind-platformio-part-i/>`_
|
* May 4, 2015 - **IT Hare** - `From Web Developer to Embedded One: Interview with Ivan Kravets, The Guy Behind PlatformIO. Part I <http://ithare.com/from-web-development-to-embedded-one-interview-with-ivan-kravets-the-guy-behind-platformio-part-i/>`_
|
||||||
|
@@ -7,6 +7,7 @@ IDE Integration
|
|||||||
:maxdepth: 2
|
:maxdepth: 2
|
||||||
|
|
||||||
ide/arduino
|
ide/arduino
|
||||||
|
ide/atom
|
||||||
ide/clion
|
ide/clion
|
||||||
ide/eclipse
|
ide/eclipse
|
||||||
ide/energia
|
ide/energia
|
||||||
|
39
docs/ide/atom.rst
Normal file
39
docs/ide/atom.rst
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
.. _ide_atom:
|
||||||
|
|
||||||
|
Atom
|
||||||
|
====
|
||||||
|
|
||||||
|
`Atom <https://atom.io>`_ is a text editor that's modern, approachable,
|
||||||
|
yet hackable to the core—a tool you can customize to do anything but also use
|
||||||
|
productively without ever touching a config file.
|
||||||
|
|
||||||
|
This software can be used with:
|
||||||
|
|
||||||
|
* all available :ref:`platforms`
|
||||||
|
* all available :ref:`frameworks`
|
||||||
|
|
||||||
|
Refer to the `Atom Documentation <https://atom.io/docs>`_
|
||||||
|
page for more detailed information.
|
||||||
|
|
||||||
|
.. contents::
|
||||||
|
|
||||||
|
Integration
|
||||||
|
-----------
|
||||||
|
|
||||||
|
Using `Atom Packages <https://atom.io/docs/v1.0.2/using-atom-atom-packages>`_
|
||||||
|
please install `platomformio <https://atom.io/packages/platomformio>`_ package.
|
||||||
|
|
||||||
|
Screenshot
|
||||||
|
----------
|
||||||
|
|
||||||
|
Building
|
||||||
|
^^^^^^^^
|
||||||
|
|
||||||
|
.. image:: ../_static/ide-platformio-atom-1.gif
|
||||||
|
:target: https://atom.io/packages/platomformio
|
||||||
|
|
||||||
|
Uploading
|
||||||
|
^^^^^^^^^
|
||||||
|
|
||||||
|
.. image:: ../_static/ide-platformio-atom-2.gif
|
||||||
|
:target: https://atom.io/packages/platomformio
|
@@ -55,11 +55,11 @@ Super-Quick (Mac / Linux)
|
|||||||
~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
To install or upgrade *PlatformIO* paste that at a *Terminal* prompt
|
To install or upgrade *PlatformIO* paste that at a *Terminal* prompt
|
||||||
(**you might need** to run ``sudo`` first):
|
(**you MIGHT need** to run ``sudo`` first, just for installation):
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
python -c "$(curl -fsSL https://raw.githubusercontent.com/platformio/platformio/master/scripts/get-platformio.py)"
|
[sudo] python -c "$(curl -fsSL https://raw.githubusercontent.com/platformio/platformio/master/scripts/get-platformio.py)"
|
||||||
|
|
||||||
|
|
||||||
Installer Script (Mac / Linux / Windows)
|
Installer Script (Mac / Linux / Windows)
|
||||||
@@ -67,12 +67,13 @@ Installer Script (Mac / Linux / Windows)
|
|||||||
|
|
||||||
To install or upgrade *PlatformIO*, download
|
To install or upgrade *PlatformIO*, download
|
||||||
`get-platformio.py <https://raw.githubusercontent.com/platformio/platformio/master/scripts/get-platformio.py>`_
|
`get-platformio.py <https://raw.githubusercontent.com/platformio/platformio/master/scripts/get-platformio.py>`_
|
||||||
script. Then run the following (you might need to run ``sudo`` first):
|
script. Then run the following (**you MIGHT need** to run ``sudo`` first,
|
||||||
|
just for installation):
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
# change directory to folder where is located downloaded "get-platformio.py"
|
# change directory to folder where is located downloaded "get-platformio.py"
|
||||||
cd /path/to/dir/where/is/installer/script
|
cd /path/to/dir/where/is/located/get-platformio.py/script
|
||||||
|
|
||||||
# run it
|
# run it
|
||||||
python get-platformio.py
|
python get-platformio.py
|
||||||
@@ -83,7 +84,7 @@ On *Windows OS* it may look like:
|
|||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
# change directory to folder where is located downloaded "get-platformio.py"
|
# change directory to folder where is located downloaded "get-platformio.py"
|
||||||
cd C:\path\to\dir\where\is\installer\script
|
cd C:\path\to\dir\where\is\located\get-platformio.py\script
|
||||||
|
|
||||||
# run it
|
# run it
|
||||||
C:\Python27\python.exe get-platformio.py
|
C:\Python27\python.exe get-platformio.py
|
||||||
|
@@ -145,6 +145,8 @@ Example of the **test** platform (``test.py``):
|
|||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
|
import os
|
||||||
|
|
||||||
from platformio.platforms.base import BasePlatform
|
from platformio.platforms.base import BasePlatform
|
||||||
|
|
||||||
class TestPlatform(BasePlatform):
|
class TestPlatform(BasePlatform):
|
||||||
|
@@ -57,6 +57,11 @@ A default value is ``%home_dir%/lib``.
|
|||||||
This option can be overridden by global environment variable
|
This option can be overridden by global environment variable
|
||||||
:ref:`envvar_PLATFORMIO_LIB_DIR`.
|
:ref:`envvar_PLATFORMIO_LIB_DIR`.
|
||||||
|
|
||||||
|
.. note::
|
||||||
|
You can put here your own/private libraries. The source code of each
|
||||||
|
library should be placed in separate directory. For example,
|
||||||
|
``%lib_dir%/private_lib/[here are source files]``.
|
||||||
|
|
||||||
.. _projectconf_pio_src_dir:
|
.. _projectconf_pio_src_dir:
|
||||||
|
|
||||||
``src_dir``
|
``src_dir``
|
||||||
|
@@ -62,6 +62,12 @@ There 3 levels of verbosity:
|
|||||||
|
|
||||||
By default, verbosity level is set to 3 (maximum information).
|
By default, verbosity level is set to 3 (maximum information).
|
||||||
|
|
||||||
|
.. option::
|
||||||
|
--disable-auto-clean
|
||||||
|
|
||||||
|
Disable auto-clean of :ref:`projectconf_pio_envs_dir` when :ref:`projectconf`
|
||||||
|
or :ref:`projectconf_pio_src_dir` (project structure) have been modified.
|
||||||
|
|
||||||
Examples
|
Examples
|
||||||
--------
|
--------
|
||||||
|
|
||||||
|
21
examples/teensy/teensy-hid-usb-mouse/README.rst
Normal file
21
examples/teensy/teensy-hid-usb-mouse/README.rst
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
How to build PlatformIO based project
|
||||||
|
=====================================
|
||||||
|
|
||||||
|
1. `Install PlatformIO <http://docs.platformio.org/en/latest/installation.html>`_
|
||||||
|
2. Download `source code with examples <https://github.com/platformio/platformio/archive/develop.zip>`_
|
||||||
|
3. Extract ZIP archive
|
||||||
|
4. Run these commands:
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
# Change directory to example
|
||||||
|
> cd platformio-develop/examples/teensy/teensy-hid-usb-mouse
|
||||||
|
|
||||||
|
# Process example project
|
||||||
|
> platformio run
|
||||||
|
|
||||||
|
# Upload firmware
|
||||||
|
> platformio run --target upload
|
||||||
|
|
||||||
|
# Clean build files
|
||||||
|
> platformio run --target clean
|
24
examples/teensy/teensy-hid-usb-mouse/platformio.ini
Normal file
24
examples/teensy/teensy-hid-usb-mouse/platformio.ini
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
#
|
||||||
|
# Project Configuration File
|
||||||
|
#
|
||||||
|
# A detailed documentation with the EXAMPLES is located here:
|
||||||
|
# http://docs.platformio.org/en/latest/projectconf.html
|
||||||
|
#
|
||||||
|
|
||||||
|
# A sign `#` at the beginning of the line indicates a comment
|
||||||
|
# Comment lines are ignored.
|
||||||
|
|
||||||
|
# Simple and base environment
|
||||||
|
# [env:mybaseenv]
|
||||||
|
# platform = %INSTALLED_PLATFORM_NAME_HERE%
|
||||||
|
# framework =
|
||||||
|
# board =
|
||||||
|
#
|
||||||
|
# Automatic targets - enable auto-uploading
|
||||||
|
# targets = upload
|
||||||
|
|
||||||
|
[env:teensy31]
|
||||||
|
platform = teensy
|
||||||
|
framework = arduino
|
||||||
|
board = teensy31
|
||||||
|
build_flags = -DTEENSY31 -UUSB_SERIAL -DUSB_SERIAL_HID
|
24
examples/teensy/teensy-hid-usb-mouse/src/TriangleMove.ino
Normal file
24
examples/teensy/teensy-hid-usb-mouse/src/TriangleMove.ino
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
/* Simple USB Mouse Example
|
||||||
|
Teensy becomes a USB mouse and moves the cursor in a triangle
|
||||||
|
|
||||||
|
You must select Mouse from the "Tools > USB Type" menu
|
||||||
|
|
||||||
|
This example code is in the public domain.
|
||||||
|
*/
|
||||||
|
|
||||||
|
void setup() { } // no setup needed
|
||||||
|
void loop() {
|
||||||
|
int i;
|
||||||
|
for (i=0; i<40; i++) {
|
||||||
|
Mouse.move(2, -1);
|
||||||
|
delay(25);
|
||||||
|
}
|
||||||
|
for (i=0; i<40; i++) {
|
||||||
|
Mouse.move(2, 2);
|
||||||
|
delay(25);
|
||||||
|
}
|
||||||
|
for (i=0; i<40; i++) {
|
||||||
|
Mouse.move(-4, -1);
|
||||||
|
delay(25);
|
||||||
|
}
|
||||||
|
}
|
@@ -1,7 +1,7 @@
|
|||||||
# Copyright (C) Ivan Kravets <me@ikravets.com>
|
# Copyright (C) Ivan Kravets <me@ikravets.com>
|
||||||
# See LICENSE for details.
|
# See LICENSE for details.
|
||||||
|
|
||||||
VERSION = (2, 2, 1)
|
VERSION = (2, 2, 2)
|
||||||
__version__ = ".".join([str(s) for s in VERSION])
|
__version__ = ".".join([str(s) for s in VERSION])
|
||||||
|
|
||||||
__title__ = "platformio"
|
__title__ = "platformio"
|
||||||
|
@@ -82,7 +82,8 @@ def main():
|
|||||||
else:
|
else:
|
||||||
error_str += format_exc()
|
error_str += format_exc()
|
||||||
click.secho(error_str, fg="red", err=True)
|
click.secho(error_str, fg="red", err=True)
|
||||||
sys_exit(1)
|
return 1
|
||||||
|
return 0
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
@@ -7,7 +7,7 @@ from os.path import isfile, join
|
|||||||
|
|
||||||
from platformio import __version__
|
from platformio import __version__
|
||||||
from platformio.exception import InvalidSettingName, InvalidSettingValue
|
from platformio.exception import InvalidSettingName, InvalidSettingValue
|
||||||
from platformio.util import get_home_dir
|
from platformio.util import get_home_dir, is_ci
|
||||||
|
|
||||||
DEFAULT_SETTINGS = {
|
DEFAULT_SETTINGS = {
|
||||||
"check_platformio_interval": {
|
"check_platformio_interval": {
|
||||||
@@ -109,8 +109,7 @@ def get_setting(name):
|
|||||||
if name == "enable_prompts":
|
if name == "enable_prompts":
|
||||||
# disable prompts for Continuous Integration systems
|
# disable prompts for Continuous Integration systems
|
||||||
# and when global "--force" option is set
|
# and when global "--force" option is set
|
||||||
if any([getenv("CI", "").lower() == "true",
|
if any([is_ci(), get_session_var("force_option")]):
|
||||||
get_session_var("force_option")]):
|
|
||||||
return False
|
return False
|
||||||
|
|
||||||
_env_name = "PLATFORMIO_SETTING_%s" % name.upper()
|
_env_name = "PLATFORMIO_SETTING_%s" % name.upper()
|
||||||
|
@@ -22,7 +22,7 @@ class InoToCPPConverter(object):
|
|||||||
|
|
||||||
DETECTMAIN_RE = re.compile(r"void\s+(setup|loop)\s*\(", re.M | re.I)
|
DETECTMAIN_RE = re.compile(r"void\s+(setup|loop)\s*\(", re.M | re.I)
|
||||||
|
|
||||||
STRIPCOMMENTS_RE = re.compile(r"(/\*.*?\*/|(^|\s+)//[^\r\n]*$)",
|
STRIPCOMMENTS_RE = re.compile(r"(/\*.*?\*/|^\s*//[^\r\n]*$)",
|
||||||
re.M | re.S)
|
re.M | re.S)
|
||||||
|
|
||||||
def __init__(self, nodes):
|
def __init__(self, nodes):
|
||||||
|
@@ -43,12 +43,13 @@ def BuildFirmware(env):
|
|||||||
)
|
)
|
||||||
|
|
||||||
# enable "cyclic reference" for linker
|
# enable "cyclic reference" for linker
|
||||||
env.Prepend(
|
if env.get("LIBS", deplibs):
|
||||||
_LIBFLAGS="-Wl,--start-group "
|
env.Prepend(
|
||||||
)
|
_LIBFLAGS="-Wl,--start-group "
|
||||||
env.Append(
|
)
|
||||||
_LIBFLAGS=" -Wl,--end-group"
|
env.Append(
|
||||||
)
|
_LIBFLAGS=" -Wl,--end-group"
|
||||||
|
)
|
||||||
|
|
||||||
# Handle SRC_BUILD_FLAGS
|
# Handle SRC_BUILD_FLAGS
|
||||||
if getenv("PLATFORMIO_SRC_BUILD_FLAGS", None):
|
if getenv("PLATFORMIO_SRC_BUILD_FLAGS", None):
|
||||||
|
@@ -26,9 +26,10 @@ from platformio.platforms.base import PlatformFactory
|
|||||||
type=click.Path(exists=True, file_okay=False, dir_okay=True,
|
type=click.Path(exists=True, file_okay=False, dir_okay=True,
|
||||||
writable=True, resolve_path=True))
|
writable=True, resolve_path=True))
|
||||||
@click.option("--verbose", "-v", count=True, default=3)
|
@click.option("--verbose", "-v", count=True, default=3)
|
||||||
|
@click.option("--disable-auto-clean", is_flag=True)
|
||||||
@click.pass_context
|
@click.pass_context
|
||||||
def cli(ctx, environment, target, upload_port, # pylint: disable=R0913,R0914
|
def cli(ctx, environment, target, upload_port, # pylint: disable=R0913,R0914
|
||||||
project_dir, verbose):
|
project_dir, verbose, disable_auto_clean):
|
||||||
with util.cd(project_dir):
|
with util.cd(project_dir):
|
||||||
config = util.get_project_config()
|
config = util.get_project_config()
|
||||||
|
|
||||||
@@ -40,7 +41,8 @@ def cli(ctx, environment, target, upload_port, # pylint: disable=R0913,R0914
|
|||||||
raise exception.UnknownEnvNames(", ".join(unknown))
|
raise exception.UnknownEnvNames(", ".join(unknown))
|
||||||
|
|
||||||
# clean obsolete .pioenvs dir
|
# clean obsolete .pioenvs dir
|
||||||
_clean_pioenvs_dir()
|
if not disable_auto_clean:
|
||||||
|
_clean_pioenvs_dir()
|
||||||
|
|
||||||
results = []
|
results = []
|
||||||
for section in config.sections():
|
for section in config.sections():
|
||||||
|
@@ -7,6 +7,7 @@ import sys
|
|||||||
import click
|
import click
|
||||||
from serial.tools import miniterm
|
from serial.tools import miniterm
|
||||||
|
|
||||||
|
from platformio.exception import PlatformioException
|
||||||
from platformio.util import get_serialports
|
from platformio.util import get_serialports
|
||||||
|
|
||||||
|
|
||||||
@@ -59,12 +60,12 @@ def serialports_list(json_output):
|
|||||||
# 1: escape non-printable characters, do newlines as unusual
|
# 1: escape non-printable characters, do newlines as unusual
|
||||||
# 2: escape non-printable characters, newlines too
|
# 2: escape non-printable characters, newlines too
|
||||||
# 3: hex dump everything""")
|
# 3: hex dump everything""")
|
||||||
@click.option("--exit-char", type=int, default=0x1d,
|
@click.option("--exit-char", type=int, default=29,
|
||||||
help="ASCII code of special character that is used to exit the "
|
help="ASCII code of special character that is used to exit the "
|
||||||
"application, default=0x1d")
|
"application, default=19 (DEC)")
|
||||||
@click.option("--menu-char", type=int, default=0x14,
|
@click.option("--menu-char", type=int, default=20,
|
||||||
help="ASCII code of special character that is used to control "
|
help="ASCII code of special character that is used to control "
|
||||||
"miniterm (menu), default=0x14")
|
"miniterm (menu), default=20 (DEC)")
|
||||||
@click.option("--quiet", is_flag=True,
|
@click.option("--quiet", is_flag=True,
|
||||||
help="Diagnostics: suppress non-error messages, default=Off")
|
help="Diagnostics: suppress non-error messages, default=Off")
|
||||||
def serialports_monitor(**kwargs):
|
def serialports_monitor(**kwargs):
|
||||||
@@ -78,5 +79,5 @@ def serialports_monitor(**kwargs):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
miniterm.main()
|
miniterm.main()
|
||||||
except: # pylint: disable=W0702
|
except Exception as e: # pylint: disable=W0702
|
||||||
pass
|
raise PlatformioException(str(e))
|
||||||
|
@@ -7,6 +7,7 @@ import re
|
|||||||
import sys
|
import sys
|
||||||
import threading
|
import threading
|
||||||
import uuid
|
import uuid
|
||||||
|
from os import getenv
|
||||||
from time import time
|
from time import time
|
||||||
|
|
||||||
import click
|
import click
|
||||||
@@ -197,6 +198,32 @@ def _finalize():
|
|||||||
def on_command(ctx): # pylint: disable=W0613
|
def on_command(ctx): # pylint: disable=W0613
|
||||||
mp = MeasurementProtocol()
|
mp = MeasurementProtocol()
|
||||||
mp.send("screenview")
|
mp.send("screenview")
|
||||||
|
if util.is_ci():
|
||||||
|
measure_ci()
|
||||||
|
|
||||||
|
|
||||||
|
def measure_ci():
|
||||||
|
event = {
|
||||||
|
"category": "CI",
|
||||||
|
"action": "NoName",
|
||||||
|
"label": None
|
||||||
|
}
|
||||||
|
|
||||||
|
envmap = {
|
||||||
|
"APPVEYOR": {"label": getenv("APPVEYOR_REPO_NAME")},
|
||||||
|
"CIRCLECI": {"label": "%s/%s" % (getenv("CIRCLE_PROJECT_USERNAME"),
|
||||||
|
getenv("CIRCLE_PROJECT_REPONAME"))},
|
||||||
|
"TRAVIS": {"label": getenv("TRAVIS_REPO_SLUG")},
|
||||||
|
"SHIPPABLE": {"label": getenv("REPO_NAME")},
|
||||||
|
"DRONE": {"label": getenv("DRONE_REPO_SLUG")}
|
||||||
|
}
|
||||||
|
|
||||||
|
for key, value in envmap.iteritems():
|
||||||
|
if getenv(key, "").lower() != "true":
|
||||||
|
continue
|
||||||
|
event.update({"action": key, "label": value['label']})
|
||||||
|
|
||||||
|
on_event(**event)
|
||||||
|
|
||||||
|
|
||||||
def on_run_environment(options, targets):
|
def on_run_environment(options, targets):
|
||||||
|
@@ -9,7 +9,7 @@ from tempfile import NamedTemporaryFile
|
|||||||
|
|
||||||
|
|
||||||
CURINTERPRETER_PATH = os.path.normpath(sys.executable)
|
CURINTERPRETER_PATH = os.path.normpath(sys.executable)
|
||||||
IS_WINDOWS = system() == "Windows"
|
IS_WINDOWS = system().lower() == "windows"
|
||||||
|
|
||||||
|
|
||||||
def fix_winpython_pathenv():
|
def fix_winpython_pathenv():
|
||||||
@@ -61,12 +61,12 @@ def exec_command(*args, **kwargs):
|
|||||||
out, err = p.communicate()
|
out, err = p.communicate()
|
||||||
|
|
||||||
if p.returncode != 0:
|
if p.returncode != 0:
|
||||||
raise Exception(err)
|
raise Exception("\n".join([out, err]))
|
||||||
return out
|
return out
|
||||||
|
|
||||||
|
|
||||||
def exec_python_cmd(args):
|
def exec_python_cmd(args):
|
||||||
return exec_command([CURINTERPRETER_PATH] + args, shell=IS_WINDOWS).strip()
|
return exec_command([CURINTERPRETER_PATH] + args).strip()
|
||||||
|
|
||||||
|
|
||||||
def install_pip():
|
def install_pip():
|
||||||
@@ -89,8 +89,7 @@ def install_pip():
|
|||||||
def install_pypi_packages(packages):
|
def install_pypi_packages(packages):
|
||||||
for pipargs in packages:
|
for pipargs in packages:
|
||||||
print (exec_python_cmd([
|
print (exec_python_cmd([
|
||||||
"-m",
|
"-m", "pip.__main__" if sys.version_info < (2, 7, 0) else "pip",
|
||||||
"pip.__main__" if sys.version_info < (2, 7, 0) else "pip",
|
|
||||||
"install", "-U"] + pipargs))
|
"install", "-U"] + pipargs))
|
||||||
|
|
||||||
|
|
||||||
@@ -110,14 +109,27 @@ def main():
|
|||||||
|
|
||||||
is_error = False
|
is_error = False
|
||||||
for s in steps:
|
for s in steps:
|
||||||
|
if is_error:
|
||||||
|
break
|
||||||
print ("\n==> %s ..." % s[0])
|
print ("\n==> %s ..." % s[0])
|
||||||
try:
|
try:
|
||||||
s[1](*s[2])
|
s[1](*s[2])
|
||||||
print ("[SUCCESS]")
|
print ("[SUCCESS]")
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
is_error = True
|
is_error = True
|
||||||
print (e)
|
print (str(e))
|
||||||
print ("[FAILURE]")
|
print ("[FAILURE]")
|
||||||
|
if "Permission denied" in str(e) and not IS_WINDOWS:
|
||||||
|
print ("""
|
||||||
|
-----------------
|
||||||
|
Permission denied
|
||||||
|
-----------------
|
||||||
|
|
||||||
|
You need the `sudo` permission to install Python packages. Try
|
||||||
|
|
||||||
|
$ sudo python -c "$(curl -fsSL
|
||||||
|
https://raw.githubusercontent.com/platformio/platformio/master/scripts/get-platformio.py)"
|
||||||
|
""")
|
||||||
|
|
||||||
if is_error:
|
if is_error:
|
||||||
print ("The installation process has been FAILED!\n"
|
print ("The installation process has been FAILED!\n"
|
||||||
@@ -129,16 +141,25 @@ def main():
|
|||||||
"successfully FINISHED! <==\n")
|
"successfully FINISHED! <==\n")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
print (exec_command("platformio", shell=IS_WINDOWS))
|
print (exec_command("platformio"))
|
||||||
except:
|
except:
|
||||||
try:
|
try:
|
||||||
print (exec_python_cmd([
|
print (exec_python_cmd([
|
||||||
"-m",
|
"-m",
|
||||||
"platformio.__main__" if sys.version_info < (2, 7, 0) else
|
"platformio.__main__" if sys.version_info < (2, 7, 0) else
|
||||||
"platformio"]))
|
"platformio"]))
|
||||||
finally:
|
except:
|
||||||
print ("\n Please RESTART your Terminal Application and run "
|
pass
|
||||||
"`platformio --help` command.")
|
finally:
|
||||||
|
print ("""
|
||||||
|
|
||||||
|
----------------------------------------
|
||||||
|
Please RESTART your Terminal Application
|
||||||
|
----------------------------------------
|
||||||
|
|
||||||
|
Then run `platformio --help` command.
|
||||||
|
|
||||||
|
""")
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
@@ -52,19 +52,25 @@ def validate_package(url, sfpkglist):
|
|||||||
|
|
||||||
def test_package(package_data, sfpkglist):
|
def test_package(package_data, sfpkglist):
|
||||||
assert package_data['url'].endswith("%d.tar.gz" % package_data['version'])
|
assert package_data['url'].endswith("%d.tar.gz" % package_data['version'])
|
||||||
|
sf_package = "sourceforge.net" in package_data['url']
|
||||||
|
|
||||||
# check content type and that file exists
|
# check content type and that file exists
|
||||||
try:
|
try:
|
||||||
r = requests.head(package_data['url'], allow_redirects=True)
|
r = requests.head(package_data['url'], allow_redirects=True)
|
||||||
if 500 <= r.status_code <= 599:
|
if 500 <= r.status_code <= 599:
|
||||||
raise requests.exceptions.ConnectionError()
|
raise requests.exceptions.ConnectionError()
|
||||||
except requests.exceptions.ConnectionError:
|
except requests.exceptions.ConnectionError as e:
|
||||||
return pytest.skip("SF is off-line")
|
if sf_package:
|
||||||
|
return pytest.skip("SF is off-line")
|
||||||
|
raise Exception(e)
|
||||||
|
|
||||||
validate_response(r)
|
validate_response(r)
|
||||||
assert r.headers['Content-Type'] in ("application/x-gzip",
|
assert r.headers['Content-Type'] in ("application/x-gzip",
|
||||||
"application/octet-stream")
|
"application/octet-stream")
|
||||||
|
|
||||||
|
if not sf_package:
|
||||||
|
return
|
||||||
|
|
||||||
# check sha1 sum
|
# check sha1 sum
|
||||||
if sfpkglist is None:
|
if sfpkglist is None:
|
||||||
return pytest.skip("SF is off-line")
|
return pytest.skip("SF is off-line")
|
||||||
|
Reference in New Issue
Block a user