Python 3.13: Fix and polish #1

Merged
vilmibm merged 15 commits from noelle/tilde-train:python-3.13 into trunk 2025-06-02 22:23:23 +00:00
Showing only changes of commit 7a74050c5d - Show all commits

View File

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