twitter: use better variable for the tweet chain link

Using "last" can also imply "final", "prior" is more helpful

Change-Id: Ie601373ec6441dd90bc4447359a50c20663639df
This commit is contained in:
Ian Wienand 2022-04-06 11:20:51 +10:00
parent 0b290dc863
commit 8097c54a2e
1 changed files with 5 additions and 5 deletions

View File

@ -264,13 +264,13 @@ class Tweet(UpdateInterface):
tweets[i] = tweet + " %d/%d" % (i+1, len(tweets))
try:
last_tweet = None
prior_tweet = None
for tweet in tweets:
if not last_tweet:
last_tweet = self.api.update_status(status=tweet)
if not prior_tweet:
prior_tweet = self.api.update_status(status=tweet)
else:
last_tweet = self.api.update_status(status=tweet,
in_reply_to_status_id = last_tweet.id,
prior_tweet = self.api.update_status(status=tweet,
in_reply_to_status_id = prior_tweet.id,
auto_populate_reply_metadata=True)
except tweepy.TweepyException as e:
self.log.exception("Failed to tweet")