-
Notifications
You must be signed in to change notification settings - Fork 72
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
Weather description #92
Comments
Try this: def format_weather_description(weather_description):
if len(weather_description) < 20:
return {1: weather_description, 2: '', 3: ''}
splits = textwrap.fill(weather_description, 20, break_long_words=False,
max_lines=3, placeholder='...').split('\n')
weather_dict = {1: splits[0]}
weather_dict[2] = splits[1] if len(splits) > 1 else ''
weather_dict[3] = splits[2] if len(splits) > 2 else ''
return weather_dict You'll need to add the third line here:
And also in the SVG layout file. |
By default it should be screen-template.1.svg but if you picked any other LAYOUT variable from here, then the corresponding number. eg if you did SCREEN_LAYOUT=2, then edit screen-template.2.svg. |
It worked perfect |
Very good! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How can I add another line for the description?
I managed to get the language to german, but now the description is too long.
I changed the max_lines=3 but it still only shoes two lines. Where do I need to change the code aswell?
ef format_weather_description(weather_description):
if len(weather_description) < 20:
return {1: weather_description, 2: '', 3: ''}
The text was updated successfully, but these errors were encountered: