Skip to content

Commit

Permalink
Fix some (probably unicode-related) intermittent problems with import…
Browse files Browse the repository at this point in the history
… by ignoring them
  • Loading branch information
enkiv2 committed Jun 17, 2020
1 parent 46067d6 commit c56659b
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions fern
Original file line number Diff line number Diff line change
Expand Up @@ -492,21 +492,23 @@ def execCommand(cmd):
statuses=mastodon.account_statuses(mastodon.account_verify_credentials()["id"])
page=1
while statuses != None:
for status in statuses:
try:
tid=status["id"]
if not tid in tootbase:
statusMsg("Fetching "+tid, False)
tootbase[tid]=copy.deepcopy(status)
tb_dirty[int(tid[-2:])]=True
execCommand("open_tid "+tid)
execCommand("expand_thread")
except Exception as e: statusMsg(str(e), False)
drawPanelContents(tl[tlIdx:], hlIdx)
page+=1
statusMsg("Getting statuses... page "+str(page), False)
try: statuses=mastodon.fetch_next(statuses)
except: statuses=None
try:
for status in statuses:
try:
tid=status["id"]
if not tid in tootbase:
statusMsg("Fetching "+tid, False)
tootbase[tid]=copy.deepcopy(status)
tb_dirty[int(tid[-2:])]=True
execCommand("open_tid "+tid)
execCommand("expand_thread")
except Exception as e: statusMsg(str(e), False)
drawPanelContents(tl[tlIdx:], hlIdx)
page+=1
statusMsg("Getting statuses... page "+str(page), False)
try: statuses=mastodon.fetch_next(statuses)
except: statuses=None
except Exception as e: pass
drawPanelContents(tl[tlIdx:], hlIdx)
statusMsg("Getting favorites...", False)
favourites=mastodon.favourites()
Expand Down

0 comments on commit c56659b

Please sign in to comment.