Files
pynamics/tests/pynamics-ansi.py

23 lines
1010 B
Python
Raw Normal View History

2026-04-10 16:27:41 +00:00
# Escape codes:
# event 0: notify
# event 1:
lvldict = {
0: "FATAL",
1: "ALERT",
2: "CRIT",
3: "ERR",
4: "WARNING",
5: "NOTICE",
6: "INFO",
7: "DEBUG"
}
def sendCommand(eventnum, level, msg):
print(f"\x1b[?PYN;{eventnum.str()};{lvldict[level]};{msg}~")
sendCommand(0, 0, "UNRECOVERABLE MICROPYTHON ERROR!!!!! EXITING PROGRAM VERY MUCH UNGRACEFULLY")
sendCommand(0, 1, "hey you should probably know that your RAM is corrupted and you cant buy more because of the shortage")
sendCommand(0, 2, "so the program is running but everything deleted so its kinda frying ur motors")
sendCommand(0, 3, "syntax error you failure. use a linter")
sendCommand(0, 4, "wanted to just say that your motor is kinda being slow")
sendCommand(0, 5, "so your motor is like 1% slower than it should be but really no one cares")
sendCommand(0, 6, "hey everything in the program is going well just in case nothing in your life is")
sendCommand(0, 7, "nobody cares about me but you should know that")