aboutsummaryrefslogtreecommitdiffstats
path: root/youtube
diff options
context:
space:
mode:
authorJames Taylor <user234683@users.noreply.github.com>2019-06-09 18:01:46 -0700
committerJames Taylor <user234683@users.noreply.github.com>2019-06-09 18:01:46 -0700
commit83f3dfaff54e27f59153980466685e77c4bf12cb (patch)
treeebb27af90bb29c4ec51d1603f4436355674774bd /youtube
parent27ee2990e97b1e73df41c1512332a1facd56f759 (diff)
downloadyt-local-83f3dfaff54e27f59153980466685e77c4bf12cb.tar.lz
yt-local-83f3dfaff54e27f59153980466685e77c4bf12cb.tar.xz
yt-local-83f3dfaff54e27f59153980466685e77c4bf12cb.zip
simplify list_from_comma_separated_tags
Diffstat (limited to 'youtube')
-rw-r--r--youtube/subscriptions.py16
1 files changed, 1 insertions, 15 deletions
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('''