forked from platformio/platformio-core
Merge branch 'develop' of https://github.com/ivankravets/platformio into feature/pyserial-3.0
This commit is contained in:
commit
2997273654
13 files changed
+139
-50
No files matched your search
@@ -1,7 +1,7 @@
|
||||
# Copyright (C) Ivan Kravets <me@ikravets.com>
|
||||
# See LICENSE for details.
|
||||
|
||||
VERSION = (2, 3, 3)
|
||||
VERSION = (2, 3, "4.dev1")
|
||||
__version__ = ".".join([str(s) for s in VERSION])
|
||||
|
||||
__title__ = "platformio"
|
||||
|
||||
@@ -1,4 +1,26 @@
|
||||
{
|
||||
"ardhat": {
|
||||
"build": {
|
||||
"core": "arduino",
|
||||
"extra_flags": "-DARDUINO_ARCH_AVR -DAVR_ARDHAT",
|
||||
"f_cpu": "16000000L",
|
||||
"mcu": "atmega328p",
|
||||
"variant": "standard"
|
||||
},
|
||||
"frameworks": ["arduino"],
|
||||
"name": "ubIQio Ardhat",
|
||||
"platform": "atmelavr",
|
||||
"upload": {
|
||||
"maximum_ram_size": 2048,
|
||||
"maximum_size": 32256,
|
||||
"protocol": "arduino",
|
||||
"require_upload_port" : true,
|
||||
"speed": 115200
|
||||
},
|
||||
"url": "http://ardhat.com",
|
||||
"vendor": "ubIQio"
|
||||
},
|
||||
|
||||
"raspduino": {
|
||||
"build": {
|
||||
"core": "arduino",
|
||||
|
||||
@@ -36,13 +36,19 @@ def cli(ctx, environment, target, upload_port, # pylint: disable=R0913,R0914
|
||||
if not config.sections():
|
||||
raise exception.ProjectEnvsNotAvailable()
|
||||
|
||||
unknown = set(environment) - set([s[4:] for s in config.sections()])
|
||||
known = set([s[4:] for s in config.sections()
|
||||
if s.startswith("env:")])
|
||||
unknown = set(environment) - known
|
||||
if unknown:
|
||||
raise exception.UnknownEnvNames(", ".join(unknown))
|
||||
raise exception.UnknownEnvNames(
|
||||
", ".join(unknown), ", ".join(known))
|
||||
|
||||
# clean obsolete .pioenvs dir
|
||||
if not disable_auto_clean:
|
||||
_clean_pioenvs_dir()
|
||||
try:
|
||||
_clean_pioenvs_dir(util.get_pioenvs_dir())
|
||||
except Exception:
|
||||
raise exception.CleanPioenvsDirError(util.get_pioenvs_dir())
|
||||
|
||||
results = []
|
||||
for section in config.sections():
|
||||
@@ -221,8 +227,7 @@ def _autoinstall_libs(ctx, libids_list):
|
||||
ctx.invoke(cmd_lib_install, libid=not_intalled_libs)
|
||||
|
||||
|
||||
def _clean_pioenvs_dir():
|
||||
pioenvs_dir = util.get_pioenvs_dir()
|
||||
def _clean_pioenvs_dir(pioenvs_dir):
|
||||
structhash_file = join(pioenvs_dir, "structure.hash")
|
||||
proj_hash = calculate_project_hash()
|
||||
|
||||
|
||||
+28
-30
@@ -33,14 +33,14 @@ class UnknownPlatform(PlatformioException):
|
||||
|
||||
class PlatformNotInstalledYet(PlatformioException):
|
||||
|
||||
MESSAGE = ("The platform '%s' has not been installed yet. "
|
||||
"Use `platformio platforms install` command")
|
||||
MESSAGE = "The platform '%s' has not been installed yet. "\
|
||||
"Use `platformio platforms install` command"
|
||||
|
||||
|
||||
class UnknownCLICommand(PlatformioException):
|
||||
|
||||
MESSAGE = ("Unknown command '%s'. Please use `platformio --help`"
|
||||
" to see all available commands")
|
||||
MESSAGE = "Unknown command '%s'. Please use `platformio --help`"\
|
||||
" to see all available commands"
|
||||
|
||||
|
||||
class UnknownBoard(PlatformioException):
|
||||
@@ -75,14 +75,14 @@ class FDUnrecognizedStatusCode(PlatformioException):
|
||||
|
||||
class FDSizeMismatch(PlatformioException):
|
||||
|
||||
MESSAGE = ("The size (%d bytes) of downloaded file '%s' "
|
||||
"is not equal to remote size (%d bytes)")
|
||||
MESSAGE = "The size (%d bytes) of downloaded file '%s' "\
|
||||
"is not equal to remote size (%d bytes)"
|
||||
|
||||
|
||||
class FDSHASumMismatch(PlatformioException):
|
||||
|
||||
MESSAGE = ("The 'sha1' sum '%s' of downloaded file '%s' "
|
||||
"is not equal to remote '%s'")
|
||||
MESSAGE = "The 'sha1' sum '%s' of downloaded file '%s' "\
|
||||
"is not equal to remote '%s'"
|
||||
|
||||
|
||||
class NotPlatformProject(PlatformioException):
|
||||
@@ -104,17 +104,23 @@ class UnsupportedArchiveType(PlatformioException):
|
||||
|
||||
class ProjectEnvsNotAvailable(PlatformioException):
|
||||
|
||||
MESSAGE = "Please setup environments in `platformio.ini` file."
|
||||
MESSAGE = "Please setup environments in `platformio.ini` file"
|
||||
|
||||
|
||||
class InvalidEnvName(PlatformioException):
|
||||
|
||||
MESSAGE = "Invalid environment '%s'. The name must start " "with 'env:'."
|
||||
MESSAGE = "Invalid environment '%s'. The name must start with 'env:'"
|
||||
|
||||
|
||||
class UnknownEnvNames(PlatformioException):
|
||||
|
||||
MESSAGE = "Unknown environment names '%s'."
|
||||
MESSAGE = "Unknown environment names '%s'. Valid names are '%s'"
|
||||
|
||||
|
||||
class CleanPioenvsDirError(PlatformioException):
|
||||
|
||||
MESSAGE = "Can not remove temporary directory `%s`. "\
|
||||
"Please remove it manually"
|
||||
|
||||
|
||||
class GetSerialPortsError(PlatformioException):
|
||||
@@ -124,7 +130,7 @@ class GetSerialPortsError(PlatformioException):
|
||||
|
||||
class GetLatestVersionError(PlatformioException):
|
||||
|
||||
MESSAGE = "Can't retrieve the latest PlatformIO version"
|
||||
MESSAGE = "Can not retrieve the latest PlatformIO version"
|
||||
|
||||
|
||||
class APIRequestError(PlatformioException):
|
||||
@@ -173,36 +179,28 @@ class UpgraderFailed(PlatformioException):
|
||||
|
||||
class CIBuildEnvsEmpty(PlatformioException):
|
||||
|
||||
MESSAGE = (
|
||||
"Can't find PlatformIO build environments.\nPlease specify `--board` "
|
||||
"or path to `platformio.ini` with predefined environments using "
|
||||
"`--project-conf` option"
|
||||
)
|
||||
MESSAGE = "Can't find PlatformIO build environments.\n"\
|
||||
"Please specify `--board` or path to `platformio.ini` with "\
|
||||
"predefined environments using `--project-conf` option"
|
||||
|
||||
|
||||
class SConsNotInstalled(PlatformioException):
|
||||
|
||||
MESSAGE = (
|
||||
"The PlatformIO and `scons` aren't installed properly. "
|
||||
"More details in FAQ/Troubleshooting section: "
|
||||
MESSAGE = "The PlatformIO and `scons` aren't installed properly. "\
|
||||
"More details in FAQ/Troubleshooting section: "\
|
||||
"http://docs.platformio.org/en/latest/faq.html"
|
||||
)
|
||||
|
||||
|
||||
class PlatformioUpgradeError(PlatformioException):
|
||||
|
||||
MESSAGE = (
|
||||
"%s \n\n"
|
||||
"1. Please report this issue here: "
|
||||
"https://github.com/platformio/platformio/issues \n"
|
||||
"2. Try different installation/upgrading steps: "
|
||||
MESSAGE = "%s \n\n"\
|
||||
"1. Please report this issue here: "\
|
||||
"https://github.com/platformio/platformio/issues \n"\
|
||||
"2. Try different installation/upgrading steps: "\
|
||||
"http://docs.platformio.org/en/latest/installation.html"
|
||||
)
|
||||
|
||||
|
||||
class CygwinEnvDetected(PlatformioException):
|
||||
|
||||
MESSAGE = (
|
||||
"PlatformIO does not work within Cygwin environment. "
|
||||
MESSAGE = "PlatformIO does not work within Cygwin environment. "\
|
||||
"Use native Terminal instead."
|
||||
)
|
||||
@@ -184,10 +184,12 @@ def check_platformio_upgrade():
|
||||
click.echo("")
|
||||
click.echo("*" * terminal_width)
|
||||
click.secho("There is a new version %s of PlatformIO available.\n"
|
||||
"Please upgrade it via " % latest_version,
|
||||
"Please upgrade it via `" % latest_version,
|
||||
fg="yellow", nl=False)
|
||||
click.secho("platformio upgrade", fg="cyan", nl=False)
|
||||
click.secho(" command.\nChanges: ", fg="yellow", nl=False)
|
||||
click.secho("` or `", fg="yellow", nl=False)
|
||||
click.secho("pip install -U platformio", fg="cyan", nl=False)
|
||||
click.secho("` command.\nChanges: ", fg="yellow", nl=False)
|
||||
click.secho("http://docs.platformio.org/en/latest/history.html",
|
||||
fg="cyan")
|
||||
click.echo("*" * terminal_width)
|
||||
|
||||
Reference in new issue
Block a user