forked from platformio/platformio-core
Add new setting enable_prompts
and avoid blocking / Resolve #34
This commit is contained in:
@ -1,6 +1,15 @@
|
|||||||
Release History
|
Release History
|
||||||
===============
|
===============
|
||||||
|
|
||||||
|
0.9.2 (?)
|
||||||
|
---------
|
||||||
|
|
||||||
|
* Replaced "dark blue" by "cyan" colour for the texts (`issue #33 <https://github.com/ivankravets/platformio/issues/33>`_)
|
||||||
|
* Added new setting `enable_prompts <http://docs.platformio.ikravets.com/en/latest/userguide/cmd_settings.html>`_
|
||||||
|
and allowed to disable all PlatformIO prompts (useful for cloud compilers)
|
||||||
|
(`issue #34 <https://github.com/ivankravets/platformio/issues/34>`_)
|
||||||
|
|
||||||
|
|
||||||
0.9.1 (2014-12-05)
|
0.9.1 (2014-12-05)
|
||||||
------------------
|
------------------
|
||||||
|
|
||||||
|
@ -25,6 +25,11 @@ application:
|
|||||||
`Command Prompt <http://en.wikipedia.org/wiki/Command_Prompt>`_ (``cmd.exe``)
|
`Command Prompt <http://en.wikipedia.org/wiki/Command_Prompt>`_ (``cmd.exe``)
|
||||||
application.
|
application.
|
||||||
|
|
||||||
|
.. warning::
|
||||||
|
If you are going to use *PlatformIO* for "*Cloud Compiling*", please
|
||||||
|
don't forget to turn off :ref:`enable_prompts <cmd_settings>` setting. It
|
||||||
|
will allow you to avoid blocking when call ``platformio`` like subprocess.
|
||||||
|
|
||||||
Please *choose one of* the following:
|
Please *choose one of* the following:
|
||||||
|
|
||||||
Super-Quick (Mac / Linux)
|
Super-Quick (Mac / Linux)
|
||||||
|
@ -33,6 +33,15 @@ DEFAULT_SETTINGS = {
|
|||||||
"description": ("Shares commands, platforms and libraries usage"
|
"description": ("Shares commands, platforms and libraries usage"
|
||||||
" to help us make PlatformIO better (Yes/No)"),
|
" to help us make PlatformIO better (Yes/No)"),
|
||||||
"value": True
|
"value": True
|
||||||
|
},
|
||||||
|
"enable_prompts": {
|
||||||
|
"description": (
|
||||||
|
"Can PlatformIO communicate with you via prompts: "
|
||||||
|
"propose to install platforms which aren't installed yet, "
|
||||||
|
"paginate over library search results and etc.)? ATTENTION!!! "
|
||||||
|
"If you call PlatformIO like subprocess, "
|
||||||
|
"please disable prompts to avoid blocking (Yes/No)"),
|
||||||
|
"value": True
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,6 +7,7 @@ from shutil import copyfile
|
|||||||
|
|
||||||
import click
|
import click
|
||||||
|
|
||||||
|
from platformio import app
|
||||||
from platformio.exception import ProjectInitialized
|
from platformio.exception import ProjectInitialized
|
||||||
from platformio.util import get_source_dir
|
from platformio.util import get_source_dir
|
||||||
|
|
||||||
@ -42,7 +43,8 @@ def cli(project_dir):
|
|||||||
click.echo("%s - a directory for the project specific libraries" %
|
click.echo("%s - a directory for the project specific libraries" %
|
||||||
click.style("lib", fg="cyan"))
|
click.style("lib", fg="cyan"))
|
||||||
|
|
||||||
if click.confirm("Do you want to continue?"):
|
if (not app.get_setting("enable_prompts") or
|
||||||
|
click.confirm("Do you want to continue?")):
|
||||||
for d in (src_dir, lib_dir):
|
for d in (src_dir, lib_dir):
|
||||||
if not isdir(d):
|
if not isdir(d):
|
||||||
makedirs(d)
|
makedirs(d)
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
import click
|
import click
|
||||||
|
|
||||||
|
from platformio import app
|
||||||
from platformio.exception import (LibAlreadyInstalledError,
|
from platformio.exception import (LibAlreadyInstalledError,
|
||||||
LibInstallDependencyError)
|
LibInstallDependencyError)
|
||||||
from platformio.libmanager import LibraryManager
|
from platformio.libmanager import LibraryManager
|
||||||
@ -69,7 +70,8 @@ def lib_search(query, **filters):
|
|||||||
if int(result['page'])*int(result['perpage']) >= int(result['total']):
|
if int(result['page'])*int(result['perpage']) >= int(result['total']):
|
||||||
break
|
break
|
||||||
|
|
||||||
if click.confirm("Show next libraries?"):
|
if (app.get_setting("enable_prompts") and
|
||||||
|
click.confirm("Show next libraries?")):
|
||||||
result = get_api_result(
|
result = get_api_result(
|
||||||
"/lib/search",
|
"/lib/search",
|
||||||
dict(query=query, page=str(int(result['page']) + 1))
|
dict(query=query, page=str(int(result['page']) + 1))
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
import click
|
import click
|
||||||
|
|
||||||
from platformio import exception, telemetry
|
from platformio import app, exception, telemetry
|
||||||
from platformio.commands.install import cli as cmd_install
|
from platformio.commands.install import cli as cmd_install
|
||||||
from platformio.platforms.base import PlatformFactory
|
from platformio.platforms.base import PlatformFactory
|
||||||
from platformio.util import get_project_config
|
from platformio.util import get_project_config
|
||||||
@ -68,7 +68,8 @@ def process_environment(ctx, name, options, targets, upload_port):
|
|||||||
|
|
||||||
telemetry.on_run_environment(options, envtargets)
|
telemetry.on_run_environment(options, envtargets)
|
||||||
|
|
||||||
if (platform not in PlatformFactory.get_platforms(installed=True) and
|
if (app.get_setting("enable_prompts") and
|
||||||
|
platform not in PlatformFactory.get_platforms(installed=True) and
|
||||||
click.confirm("The platform '%s' has not been installed yet. "
|
click.confirm("The platform '%s' has not been installed yet. "
|
||||||
"Would you like to install it now?" % platform)):
|
"Would you like to install it now?" % platform)):
|
||||||
ctx.invoke(cmd_install, platforms=[platform])
|
ctx.invoke(cmd_install, platforms=[platform])
|
||||||
|
@ -5,6 +5,7 @@ from datetime import datetime
|
|||||||
|
|
||||||
import click
|
import click
|
||||||
|
|
||||||
|
from platformio import app
|
||||||
from platformio.commands.install import cli as cmd_install
|
from platformio.commands.install import cli as cmd_install
|
||||||
from platformio.exception import PlatformNotInstalledYet
|
from platformio.exception import PlatformNotInstalledYet
|
||||||
from platformio.pkgmanager import PackageManager
|
from platformio.pkgmanager import PackageManager
|
||||||
@ -20,8 +21,9 @@ def cli(ctx, platform):
|
|||||||
installed=True).keys()
|
installed=True).keys()
|
||||||
|
|
||||||
if platform not in installed_platforms:
|
if platform not in installed_platforms:
|
||||||
if click.confirm("The platform '%s' has not been installed yet. "
|
if (app.get_setting("enable_prompts") and
|
||||||
"Would you like to install it now?" % platform):
|
click.confirm("The platform '%s' has not been installed yet. "
|
||||||
|
"Would you like to install it now?" % platform)):
|
||||||
ctx.invoke(cmd_install, platforms=[platform])
|
ctx.invoke(cmd_install, platforms=[platform])
|
||||||
else:
|
else:
|
||||||
raise PlatformNotInstalledYet(platform)
|
raise PlatformNotInstalledYet(platform)
|
||||||
|
Reference in New Issue
Block a user