New PIO Account with "username" and profile support

This commit is contained in:
Ivan Kravets
2020-04-19 20:03:46 +03:00
parent be6bf5052e
commit cb1058c693
7 changed files with 14 additions and 15 deletions

View File

@ -9,6 +9,7 @@ PlatformIO Core 4
4.3.2 (2020-??-??)
~~~~~~~~~~~~~~~~~~
* New `PIO Account <https://docs.platformio.org/page/plus/pio-account.html>`__ with "username" and profile support
* Open source `PIO Remote <http://docs.platformio.org/page/plus/pio-remote.html>`__ client
* Fixed PIO Unit Testing for Zephyr RTOS
* Fixed UnicodeDecodeError on Windows when network drive (NAS) is used (`issue #3417 <https://github.com/platformio/platformio-core/issues/3417>`_)

2
docs

Submodule docs updated: ae721948ba...14dee6e0b4

View File

@ -34,4 +34,5 @@ __license__ = "Apache Software License"
__copyright__ = "Copyright 2014-present PlatformIO"
__apiurl__ = "https://api.platformio.org"
__pioaccount_api__ = "https://api.accounts.platformio.org"
__pioremote_endpoint__ = "ssl:remote.platformio.org:4413"

View File

@ -20,13 +20,13 @@ import time
import requests.adapters
from requests.packages.urllib3.util.retry import Retry # pylint:disable=import-error
from platformio import app
from platformio import __pioaccount_api__, app
from platformio.commands.account import exception
class AccountClient(object):
def __init__(
self, api_base_url="https://api.accounts.platformio.org", retries=3,
self, api_base_url=__pioaccount_api__, retries=3,
):
if api_base_url.endswith("/"):
api_base_url = api_base_url[:-1]

View File

@ -44,7 +44,7 @@ def validate_username(value):
def validate_email(value):
value = str(value).strip()
if not re.match(r"^[a-z\d_.+-]+@[a-z\d\-]+\.[a-z\d\-.]+$", value, flags=re.I):
raise click.BadParameter("Invalid E-Mail address")
raise click.BadParameter("Invalid email address")
return value
@ -90,7 +90,7 @@ def account_register(username, email, password, firstname, lastname):
@cli.command("login", short_help="Log in to PIO Account")
@click.option("-u", "--username", prompt="Username or e-mail")
@click.option("-u", "--username", prompt="Username or email")
@click.option("-p", "--password", prompt=True, hide_input=True)
def account_login(username, password):
client = AccountClient()
@ -127,13 +127,13 @@ def account_token(password, regenerate, json_output):
@cli.command("forgot", short_help="Forgot password")
@click.option("--username", prompt="Username or e-mail")
@click.option("--username", prompt="Username or email")
def account_forgot(username):
client = AccountClient()
client.forgot_password(username)
return click.secho(
"If this account is registered, we will send the "
"further instructions to your E-Mail.",
"further instructions to your email.",
fg="green",
)

View File

@ -343,10 +343,10 @@ def device_monitor(ctx, agents, **kwargs):
kwargs["baud"] = kwargs["baud"] or 9600
def _tx_target(sock_dir):
pioplus_argv = ["remote", "device", "monitor"]
pioplus_argv.extend(device_helpers.options_to_argv(kwargs, project_options))
pioplus_argv.extend(["--sock", sock_dir])
subprocess.call([proc.where_is_program("platformio")] + pioplus_argv)
subcmd_argv = ["remote", "device", "monitor"]
subcmd_argv.extend(device_helpers.options_to_argv(kwargs, project_options))
subcmd_argv.extend(["--sock", sock_dir])
subprocess.call([proc.where_is_program("platformio")] + subcmd_argv)
sock_dir = mkdtemp(suffix="pio")
sock_file = os.path.join(sock_dir, "sock")

View File

@ -24,9 +24,8 @@ from platformio.proc import get_pythonexe_path
from platformio.project.config import ProjectConfig
CORE_PACKAGES = {
"contrib-piohome": "~3.1.0",
"contrib-piohome": ">=3.2.0-rc.1",
"contrib-pysite": "~2.%d%d.0" % (sys.version_info.major, sys.version_info.minor),
"tool-pioplus": "^2.6.1",
"tool-unity": "~1.20500.0",
"tool-scons": "~2.20501.7" if PY2 else "~3.30102.0",
"tool-cppcheck": "~1.189.0",
@ -34,8 +33,6 @@ CORE_PACKAGES = {
"tool-pvs-studio": "~7.5.0",
}
PIOPLUS_AUTO_UPDATES_MAX = 100
# pylint: disable=arguments-differ