From 3e54af32b01f5b5d0fb5852ea842baaac3e79c15 Mon Sep 17 00:00:00 2001 From: dherrada Date: Thu, 10 Jun 2021 11:09:21 -0400 Subject: [PATCH 1/2] Modified regex to accept uppercase characters and a forward slash --- adafruit_io/adafruit_io.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/adafruit_io/adafruit_io.py b/adafruit_io/adafruit_io.py index e91c5d9..26fcf3a 100755 --- a/adafruit_io/adafruit_io.py +++ b/adafruit_io/adafruit_io.py @@ -41,10 +41,10 @@ def validate_feed_key(feed_key): if len(feed_key) > 128: # validate feed key length raise ValueError("Feed key must be less than 128 characters.") if not bool( - re.match(r"^[a-z0-9-]+(\.[a-z0-9-]+)?$", feed_key) + re.match(r"^[a-zA-Z0-9-]+((\/|\.)[a-zA-Z0-9-]+)?$", feed_key) ): # validate key naming scheme raise TypeError( - "Feed key must contain lower case English letters, numbers, dash, and one period." + "Feed key must contain English letters, numbers, dash, and one period or one forward slash." ) From fff49a23d7c199c4b6347448e8da65eaae590455 Mon Sep 17 00:00:00 2001 From: dherrada Date: Thu, 10 Jun 2021 11:10:49 -0400 Subject: [PATCH 2/2] Fixed line-too-long --- adafruit_io/adafruit_io.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adafruit_io/adafruit_io.py b/adafruit_io/adafruit_io.py index 26fcf3a..0df4a78 100755 --- a/adafruit_io/adafruit_io.py +++ b/adafruit_io/adafruit_io.py @@ -44,7 +44,7 @@ def validate_feed_key(feed_key): re.match(r"^[a-zA-Z0-9-]+((\/|\.)[a-zA-Z0-9-]+)?$", feed_key) ): # validate key naming scheme raise TypeError( - "Feed key must contain English letters, numbers, dash, and one period or one forward slash." + "Feed key must contain English letters, numbers, dash, and a period or a forward slash." )