Allowed to pass multiple "SomePlatform" to the install/uninstall commands

This commit is contained in:
Ivan Kravets
2014-06-19 23:21:59 +03:00
parent b6809f0d3f
commit d801e65adf
4 changed files with 19 additions and 19 deletions

View File

@ -12,13 +12,9 @@ Wiring Framework (Arduino + Energia) Blink Example
$ cd platformio-develop/examples/wiring-blink/
# Install Atmel AVR development platform with Arduino Framework
$ platformio install atmelavr --with-package=framework-arduinoavr
# Install TI MSP430 development platform with Energia Framework
$ platformio install timsp430 --with-package=framework-energiamsp430
# Install TI TIVA development platform with Energia Framework
$ platformio install titiva --with-package=framework-energiativa
$ platformio install atmelavr timsp430 titiva
# Process example project
$ platformio run

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 MiB

After

Width:  |  Height:  |  Size: 4.0 MiB

View File

@ -7,13 +7,15 @@ from platformio.platforms._base import PlatformFactory
@command("install", short_help="Install new platforms")
@argument("platform")
@argument("platforms", nargs=-1)
@option('--with-package', multiple=True, metavar="<package>")
@option('--without-package', multiple=True, metavar="<package>")
def cli(platform, with_package, without_package):
def cli(platforms, with_package, without_package):
p = PlatformFactory().newPlatform(platform)
for platform in platforms:
if p.install(with_package, without_package):
secho("The platform '%s' has been successfully installed!" % platform,
fg="green")
p = PlatformFactory().newPlatform(platform)
if p.install(with_package, without_package):
secho("The platform '%s' has been successfully installed!" %
platform, fg="green")

View File

@ -9,13 +9,15 @@ from platformio.platforms._base import PlatformFactory
@command("uninstall", short_help="Uninstall the platforms")
@argument("platform")
def cli(platform):
@argument("platforms", nargs=-1)
def cli(platforms):
if platform not in PackageManager.get_installed():
raise PlatformNotInstalledYet(platform)
for platform in platforms:
p = PlatformFactory().newPlatform(platform)
if p.uninstall():
secho("The platform '%s' has been successfully "
"uninstalled!" % platform, fg="green")
if platform not in PackageManager.get_installed():
raise PlatformNotInstalledYet(platform)
p = PlatformFactory().newPlatform(platform)
if p.uninstall():
secho("The platform '%s' has been successfully "
"uninstalled!" % platform, fg="green")