From 2add59b0d6e7b2fe23ebbf032efe7d34984a4fe9 Mon Sep 17 00:00:00 2001 From: woorst Date: Sat, 16 Jul 2016 19:18:33 -0500 Subject: [PATCH] subreddit name parsing code more readable --- rtv/content.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/rtv/content.py b/rtv/content.py index 287681a..a4111be 100644 --- a/rtv/content.py +++ b/rtv/content.py @@ -395,10 +395,7 @@ class SubredditContent(Content): listing='r', period=None): # Strip leading, trailing, and redundant backslashes - n = '' - n = ''.join([n + ''.join(list(g)) if k != '/' else '/' \ - for k, g in groupby(name)]).strip(' /') - name_list = n.split('/') + name_list = [seg for seg in name.strip(' /').split('/') if seg] name_order = None if name_list[0] in ['r', 'u', 'user', 'domain'] and len(name_list) > 1: listing, name_list = name_list[0], name_list[1:]