Skip to content

Commit

Permalink
feat: Wordwrap Mii messages in Rooms
Browse files Browse the repository at this point in the history
  • Loading branch information
noahpistilli committed Jul 3, 2024
1 parent 91ddbe5 commit deac5b1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions url1/special/page.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from models import Rooms, MiiData, RoomMenu, RoomMiis, db
from room import app
from flask import send_from_directory
from textwrap import wrap


@app.route("/url1/special/<page>/page.xml")
Expand Down Expand Up @@ -35,14 +36,14 @@ def special_page_n(page):
RepeatedElement(
{
"inmsgseq": i + 1,
"inmsg": msg,
"inmsg": "\n".join(wrap(msg, 23)),
}
)
)

mii_msgs = []
for i, msg in enumerate(room_mii.mii_msg.split("\n")):
mii_msgs.append(RepeatedElement({"msgseq": i + 1, "msg": msg}))
mii_msgs.append(RepeatedElement({"msgseq": i + 1, "msg": "\n".join(wrap(msg, 23))}))

return {
"sppageid": page,
Expand Down

0 comments on commit deac5b1

Please sign in to comment.