-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add longer text strings to mailbox demo to test string truncation #8893
Conversation
@@ -0,0 +1,7 @@ | |||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam porta, odio vitae volutpat sollicitudin, neque odio lacinia lorem, non auctor metus lorem id arcu. Integer mollis luctus velit id pharetra. In id sagittis metus. Mauris ultricies, lorem et pulvinar ornare, metus augue iaculis enim, ullamcorper dictum ipsum urna sit amet augue. Nunc dapibus libero quis dui semper scelerisque. Nam dapibus feugiat est ac dapibus. Suspendisse sit amet odio ac turpis commodo volutpat ut ut massa. Etiam quam mauris, tincidunt at orci ut, eleifend aliquam sem. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's not include this file but instead just generate some text on the fly. It's ok to be garbage. Otherwise we're going to ship 2.2kB to every user forever just for a demo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. " * 10
for idx in range(0, 10): | ||
msgtime = int(dt.as_timestamp( | ||
dt.utcnow()) - 3600 * 24 * (10 - idx)) | ||
msgtxt = "This is recorded message # %d" % (idx) | ||
msgtxt = ("Message %d. %s" % |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use the string format function instead '%' -> "Bla {} is {}".format(1, 2)
…me-assistant#8893) * Add longer text strings to mailbox demo to test string truncation in frontend * Remove lorem ipsum txt file * Use format instead of %
Description:
This is just a minor change to add longer text messages to the mailbox demo to make it easier to test string truncation in the frontend.
I would like the frontend to show only the 1st 2 lines of a message, and need longer messages to demonstrate that. This code has no other effect, and if the current frontend code is sufficient, maybe no need to pull this change.
The related frontend request is here:
home-assistant/frontend#319
Checklist:
If the code does not interact with devices:
tox
run successfully. Your PR cannot be merged unless tests pass