Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions src/frogtips/frogsay.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from frogtips import constants
import random
import os
import shutil


def say(text_to_say, tip_id=0):
Expand All @@ -23,10 +23,7 @@ def say(text_to_say, tip_id=0):
frog_image_width = get_max_width(frog_image.split("\n"))

# Determine the width of the terminal
try:
columns, rows = os.get_terminal_size(0)
except OSError:
columns, rows = os.get_terminal_size(1)
columns, rows = shutil.get_terminal_size()

# Determine the maximum width of the output text.
# The number 4 is determined by taking one character for each side of the
Expand Down