Rewrite print_help to a single string

This commit is contained in:
noelle 2025-06-01 21:27:31 -04:00
parent 6d4e7c7914
commit 7a74050c5d
Signed by: noelle
SSH Key Fingerprint: SHA256:30qkkOn+Czx9ud36Ekl0NB/y+W4c25oREt+qmasrU9w

View File

@ -42,6 +42,7 @@ import curses
from signal import signal, SIGINT
import time ## allowing the loop steps of train animation to be slowed
import string ## for input validation
from inspect import cleandoc
traincarFN = ".choochoo"
max_x = 35 ## max length of train car.
@ -90,30 +91,34 @@ default_car = [
]
def print_help():
print("")
print("~ ~ Hooray! You've found the tilde.train! ~ ~")
print("")
print("To add your own car to a future train, create")
print("a .choochoo file in your home directory and")
print("make sure it is 'other' readable, for example:")
print("")
print(" chmod 644 ~/.choochoo")
print("")
print("The file should contain an ascii drawing of a")
print("train car no more than " + str(max_x) + " characters wide")
print("and " + str(max_y) + " characters tall.")
print("")
print("Only printable ascii characters are accepted for now.")
print("Run the command again followed by a -t switch to test")
print("your .choochoo file and report any non accepted chars.")
print("")
print("Each train contains a random selection of cars")
print("from across tilde.town user home directories.")
print("Don't worry, yours will be coming around the")
print("bend soon!")
print("")
print("~ ~ ~ ~ ~ ~")
print("")
print(
cleandoc(
f"""
~ ~ Hooray! You've found the tilde.train! ~ ~
To add your own car to a future train, create
a .choochoo file in your home directory and
make sure it is 'other' readable, for example:
chmod 644 ~/.choochoo
The file should contain an ascii drawing of a
train car no more than {max_x} characters wide
and {max_y} characters tall.
Only printable ascii characters are accepted for now.
Run the command again followed by a -t switch to test
your .choochoo file and report any non accepted chars.
Each train contains a random selection of cars
from across tilde.town user home directories.
Don't worry, yours will be coming around the
bend soon!
~ ~ ~ ~ ~ ~
"""
)
)
def test_user_car():