Skip to content

Commit

Permalink
adding sublist checker
Browse files Browse the repository at this point in the history
  • Loading branch information
modgethanc committed Oct 13, 2018
1 parent 16d2653 commit f8c6f16
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions ttbp/ttbp.py
Original file line number Diff line number Diff line change
Expand Up @@ -704,6 +704,17 @@ def subscription_handler(intro=""):
subprocess.call(["touch", config.SUBS])
subprocess.call(["chmod", "600", config.SUBS])

subs_raw = []
if os.path.isfile(config.SUBS):
for line in open(config.SUBS, "r"):
subs_raw.append(line.rstrip())

subs = []
all_users = core.find_ttbps()
for name in subs_raw:
if name in all_users:
subs.append(name)

menuOptions = [
"view subscribed feed",
"manage subscriptions"
Expand All @@ -717,9 +728,13 @@ def subscription_handler(intro=""):

if choice is not False:
if choice == 0:
print(DUST)
if len(subs) > 0:
redraw("recent entries from your subscribed pals:")
view_subscribed_feed(subs)
else:
intro = "it doesn't look like you have any subscriptions to see! add pals with 'manage subscriptions' here."
elif choice == 1:
print(DUST)
intro = DUST
else:
redraw()
return
Expand Down Expand Up @@ -1323,10 +1338,13 @@ def view_global_feed():

return

def view_subscribed_feed():
def view_subscribed_feed(subs):
'''
display list of most recent entries on user's subscribed list.
'''
(entries, metas)= feed_list(subs)
list_entries(metas, entries, "recent entries from your subscribed pals:")
redraw()

return

Expand Down

0 comments on commit f8c6f16

Please sign in to comment.