forked from platformio/platformio-core
* develop: (21 commits) Use stable docs Version bump to 2.11.2 (issues #500, #533, #732, #731, #737, #733, #438, #722, #52, #725) Update project configuration template Use stable docs Implement firmware merging with base firmware for Nordic nRF51 development platform // Resolve #500 , Resolve #533 Fix firmware uploading to Atmel SAMD21-XPRO board using ARM mbed framework // Resolve #732 Add firmware merging process for nordicnrf51 // Issue #533, #500 Add OpenOCD as an alternative upload method for atmelsam platform // Issue #732 Sync flags parser with PlatformIO 3.0 branch // Resolve #738 Update ``udev`` rules for the new STM32F407DISCOVERY boards // Resolve #731 Add explanation about "Failed to find MSBuild toolsets directory" Add support for local "--echo" for Serial Port Monitor // Resolve #733 Update history Improve support for Microchip PIC32 development platform and ChipKIT boards // Resolve #438 Fix Project Generator for ESP8266 and ARM mbed based projects Switch to gcc-built LwIP library for espressif platform Push 2.11.2.dev2 Fix linking process for microchippic32 platfrom // Issue #438 Improve Project Generator for PlatformIO IDE (fixes incorrect linter errors)
202 lines
4.9 KiB
Python
202 lines
4.9 KiB
Python
# Copyright 2014-present Ivan Kravets <me@ikravets.com>
|
|
#
|
|
# 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.
|
|
|
|
|
|
class PlatformioException(Exception):
|
|
|
|
MESSAGE = None
|
|
|
|
def __str__(self): # pragma: no cover
|
|
if self.MESSAGE:
|
|
return self.MESSAGE.format(*self.args)
|
|
else:
|
|
return Exception.__str__(self)
|
|
|
|
|
|
class ReturnErrorCode(PlatformioException):
|
|
pass
|
|
|
|
|
|
class MinitermException(PlatformioException):
|
|
pass
|
|
|
|
|
|
class AbortedByUser(PlatformioException):
|
|
|
|
MESSAGE = "Aborted by user"
|
|
|
|
|
|
class UnknownPlatform(PlatformioException):
|
|
|
|
MESSAGE = "Unknown platform '{0}'"
|
|
|
|
|
|
class PlatformNotInstalledYet(PlatformioException):
|
|
|
|
MESSAGE = "The platform '{0}' has not been installed yet. "\
|
|
"Use `platformio platforms install {0}` command"
|
|
|
|
|
|
class BoardNotDefined(PlatformioException):
|
|
|
|
MESSAGE = "You need to specify board type using `-b` or `--board` "\
|
|
"option. Supported boards list is available via "\
|
|
" `platformio boards` command"
|
|
|
|
|
|
class UnknownBoard(PlatformioException):
|
|
|
|
MESSAGE = "Unknown board ID '{0}'"
|
|
|
|
|
|
class UnknownFramework(PlatformioException):
|
|
|
|
MESSAGE = "Unknown framework '{0}'"
|
|
|
|
|
|
class UnknownPackage(PlatformioException):
|
|
|
|
MESSAGE = "Detected unknown package '{0}'"
|
|
|
|
|
|
class UndefinedPackageVersion(PlatformioException):
|
|
|
|
MESSAGE = "Could not find a version that satisfies the requirement '{0}'"\
|
|
" for your system '{1}'"
|
|
|
|
|
|
class PackageInstallError(PlatformioException):
|
|
|
|
MESSAGE = "Can not install '{0}' with version requirements '{1}' "\
|
|
"for your system '{2}'"
|
|
|
|
|
|
class FDUnrecognizedStatusCode(PlatformioException):
|
|
|
|
MESSAGE = "Got an unrecognized status code '{0}' when downloaded {1}"
|
|
|
|
|
|
class FDSizeMismatch(PlatformioException):
|
|
|
|
MESSAGE = "The size ({0:d} bytes) of downloaded file '{1}' "\
|
|
"is not equal to remote size ({2:d} bytes)"
|
|
|
|
|
|
class FDSHASumMismatch(PlatformioException):
|
|
|
|
MESSAGE = "The 'sha1' sum '{0}' of downloaded file '{1}' "\
|
|
"is not equal to remote '{2}'"
|
|
|
|
|
|
class NotPlatformIOProject(PlatformioException):
|
|
|
|
MESSAGE = "Not a PlatformIO project. `platformio.ini` file has not been "\
|
|
"found in current working directory ({0}). To initialize new project "\
|
|
"please use `platformio init` command"
|
|
|
|
|
|
class UndefinedEnvPlatform(PlatformioException):
|
|
|
|
MESSAGE = "Please specify platform for '{0}' environment"
|
|
|
|
|
|
class UnsupportedArchiveType(PlatformioException):
|
|
|
|
MESSAGE = "Can not unpack file '{0}'"
|
|
|
|
|
|
class ProjectEnvsNotAvailable(PlatformioException):
|
|
|
|
MESSAGE = "Please setup environments in `platformio.ini` file"
|
|
|
|
|
|
class InvalidEnvName(PlatformioException):
|
|
|
|
MESSAGE = "Invalid environment '{0}'. The name must start with 'env:'"
|
|
|
|
|
|
class UnknownEnvNames(PlatformioException):
|
|
|
|
MESSAGE = "Unknown environment names '{0}'. Valid names are '{1}'"
|
|
|
|
|
|
class GetSerialPortsError(PlatformioException):
|
|
|
|
MESSAGE = "No implementation for your platform ('{0}') available"
|
|
|
|
|
|
class GetLatestVersionError(PlatformioException):
|
|
|
|
MESSAGE = "Can not retrieve the latest PlatformIO version"
|
|
|
|
|
|
class APIRequestError(PlatformioException):
|
|
|
|
MESSAGE = "[API] {0}"
|
|
|
|
|
|
class LibNotFound(PlatformioException):
|
|
|
|
MESSAGE = "Library `{0}` has not been found in the registry"
|
|
|
|
|
|
class InvalidLibConfURL(PlatformioException):
|
|
|
|
MESSAGE = "Invalid library config URL '{0}'"
|
|
|
|
|
|
class BuildScriptNotFound(PlatformioException):
|
|
|
|
MESSAGE = "Invalid path '{0}' to build script"
|
|
|
|
|
|
class InvalidSettingName(PlatformioException):
|
|
|
|
MESSAGE = "Invalid setting with the name '{0}'"
|
|
|
|
|
|
class InvalidSettingValue(PlatformioException):
|
|
|
|
MESSAGE = "Invalid value '{0}' for the setting '{1}'"
|
|
|
|
|
|
class CIBuildEnvsEmpty(PlatformioException):
|
|
|
|
MESSAGE = "Can't find PlatformIO build environments.\n"\
|
|
"Please specify `--board` or path to `platformio.ini` with "\
|
|
"predefined environments using `--project-conf` option"
|
|
|
|
|
|
class TestDirEmpty(PlatformioException):
|
|
|
|
MESSAGE = "Test directory '{0}' is empty. More details about Unit "\
|
|
"Testing:\n http://docs.platformio.org/en/latest/platforms/"\
|
|
"unit_testing.html"
|
|
|
|
|
|
class UpgradeError(PlatformioException):
|
|
|
|
MESSAGE = """{0}
|
|
|
|
* Upgrade using `pip install -U platformio`
|
|
* Try different installation/upgrading steps:
|
|
http://docs.platformio.org/en/stable/installation.html
|
|
"""
|
|
|
|
|
|
class CygwinEnvDetected(PlatformioException):
|
|
|
|
MESSAGE = "PlatformIO does not work within Cygwin environment. "\
|
|
"Use native Terminal instead."
|