From 1d8fb197310ed12c0c5ccab6c889e224a5bd079b Mon Sep 17 00:00:00 2001 From: Oscar Domingo Date: Sat, 16 Oct 2021 13:58:41 +0000 Subject: [PATCH] Fixup Fixed slightly wrong logic. --- mastotuit.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/mastotuit.py b/mastotuit.py index 3a03ed5..b036e08 100644 --- a/mastotuit.py +++ b/mastotuit.py @@ -51,9 +51,6 @@ def get_toot(title): return tuit_text def compose_tweet(tuit_text, with_images, is_reply): - - tuit_max_length = 250 if len(tuit_text) > 280 else 275 - tuit_text2 = '' images_ids = [] if with_images: @@ -92,10 +89,11 @@ def compose_tweet(tuit_text, with_images, is_reply): sys.exit(err) # Compose tuit + tuit_text2 = '' + + if len(tuit_text) > 280: + tuit_max_length = 250 if with_images else 275 - # This means that the OG tweet is bigger than 280 - # Thus we need to break it down in two - if tuit_max_length == 250: tuit_text = '{0} (1/2)'.format( tuit_text[:tuit_max_length].rsplit(' ', 1)[0] )