Skip to content

Commit

Permalink
verbosity control for thread expansion
Browse files Browse the repository at this point in the history
  • Loading branch information
enkiv2 committed Jul 14, 2022
1 parent 27dbc64 commit 758ead0
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions fern
Original file line number Diff line number Diff line change
Expand Up @@ -554,10 +554,13 @@ def execCommand(cmd):
tlIdx=tootsPerPage*int(position/tootsPerPage)
if(hlIdx+tlIdx>=len(tl)): hlIdx+=((hlIdx+tlIdx)-len(tl))

def expandThread(tid):
statusMsg("Expanding thread...", False)
def expandThread(tid, verbose=False):
if verbose:
statusMsg("Expanding thread...", False)
ensureCached(tid)
while tootbase[tid]["in_reply_to_id"]!=None:
statusMsg("Expanding thread... (ID "+str(tid)+")", False)
if verbose:
statusMsg("Expanding thread... (ID "+str(tid)+")", False)
tid=tootbase[tid]["in_reply_to_id"]
ensureCached(tid)
toots=[tootbase[tid]]
Expand Down Expand Up @@ -620,7 +623,7 @@ def ensureCached(toot, verbose=False, ignoreErrors=True, msg=None):
if None==toot:
return None
if type(toot)==list: # list of TIDs or toots
return list(map(lambda x: ensureCached(x, verbose, ignoreErrors, msg), toot))
return [x for x in list(map(lambda x: ensureCached(x, verbose, ignoreErrors, msg), toot)) if None!=x]
elif type(toot) in [str, unicode]: # TID
if not toot in tootbase:
if verbose:
Expand Down

0 comments on commit 758ead0

Please sign in to comment.