From 87b5fbd237651ec7e7da35d040cde8d69a9803d1 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Wed, 3 Jun 2020 22:34:37 +0300 Subject: [PATCH] More cosmetic changes to Org CLI --- platformio/commands/account.py | 2 +- platformio/commands/org.py | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/platformio/commands/account.py b/platformio/commands/account.py index 39cca5bd..67603224 100644 --- a/platformio/commands/account.py +++ b/platformio/commands/account.py @@ -34,7 +34,7 @@ def validate_username(value, field="username"): if not re.match(r"^[a-z\d](?:[a-z\d]|-(?=[a-z\d])){0,37}$", value, flags=re.I): raise click.BadParameter( "Invalid %s format. " - "%s may only contain alphanumeric characters " + "%s must only contain alphanumeric characters " "or single hyphens, cannot begin or end with a hyphen, " "and must not be longer than 38 characters." % (field.lower(), field.capitalize()) diff --git a/platformio/commands/org.py b/platformio/commands/org.py index 5cf0b13b..d5f7a2f9 100644 --- a/platformio/commands/org.py +++ b/platformio/commands/org.py @@ -43,7 +43,9 @@ def validate_orgname(value): def org_create(orgname, email, display_name): client = AccountClient() client.create_org(orgname, email, display_name) - return click.secho("An organization has been successfully created.", fg="green",) + return click.secho( + "The organization %s has been successfully created." % orgname, fg="green", + ) @cli.command("list", short_help="List organizations") @@ -100,7 +102,9 @@ def org_update(orgname, **kwargs): {key.replace("new_", ""): value for key, value in kwargs.items() if value} ) client.update_org(orgname, new_org) - return click.secho("An organization has been successfully updated.", fg="green",) + return click.secho( + "The organization %s has been successfully updated." % orgname, fg="green", + ) @cli.command("add", short_help="Add a new owner to organization") @@ -110,7 +114,9 @@ def org_add_owner(orgname, username): client = AccountClient() client.add_org_owner(orgname, username) return click.secho( - "A new owner has been successfully added to the organization.", fg="green", + "The new owner %s has been successfully added to the %s organization." + % (username, orgname), + fg="green", ) @@ -121,5 +127,7 @@ def org_remove_owner(orgname, username): client = AccountClient() client.remove_org_owner(orgname, username) return click.secho( - "An owner has been successfully removed from the organization.", fg="green", + "The %s owner has been successfully removed from the %s organization." + % (username, orgname), + fg="green", )