From 83f3dfaff54e27f59153980466685e77c4bf12cb Mon Sep 17 00:00:00 2001 From: James Taylor Date: Sun, 9 Jun 2019 18:01:46 -0700 Subject: simplify list_from_comma_separated_tags --- youtube/subscriptions.py | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) (limited to 'youtube') diff --git a/youtube/subscriptions.py b/youtube/subscriptions.py index ba27655..be4ea1d 100644 --- a/youtube/subscriptions.py +++ b/youtube/subscriptions.py @@ -362,21 +362,7 @@ def get_subscription_manager_page(env, start_response): ).encode('utf-8') def list_from_comma_separated_tags(string): - tags = [] - prev_comma = -1 - next_comma = string.find(',') - while next_comma != -1: - tag = string[prev_comma+1:next_comma].strip() - if tag: - tags.append(tag) - - prev_comma = next_comma - next_comma = string.find(',', prev_comma+1) - - last_tag = string[prev_comma+1:].strip() - if last_tag: - tags.append(last_tag) - return tags + return [tag.strip() for tag in string.split(',') if tag.strip()] unsubscribe_list_item_template = Template(''' -- cgit v1.2.3