-
Notifications
You must be signed in to change notification settings - Fork 19
Fix index error if datafields outnumber values #40
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
Conversation
adafruit_portalbase/__init__.py
Outdated
@@ -392,7 +392,7 @@ def _fill_text_labels(self, values): | |||
if self._text: | |||
value_index = 0 # In case values and text is not the same | |||
for i in range(len(self._text)): | |||
if not self._text[i]["is_data"]: | |||
if not self._text[i]["is_data"] or value_index > len(values) - 1: |
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.
wanna add some parens here?
adafruit_portalbase/__init__.py
Outdated
@@ -392,7 +392,7 @@ def _fill_text_labels(self, values): | |||
if self._text: | |||
value_index = 0 # In case values and text is not the same | |||
for i in range(len(self._text)): | |||
if not self._text[i]["is_data"]: | |||
if not self._text[i]["is_data"] or (value_index > len(values) - 1): |
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.
if (not self._text[i]["is_data"]) or (value_index > (len(values) - 1)):
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.
gotcha, thanks
adafruit_portalbase/__init__.py
Outdated
@@ -392,7 +392,7 @@ def _fill_text_labels(self, values): | |||
if self._text: | |||
value_index = 0 # In case values and text is not the same | |||
for i in range(len(self._text)): | |||
if not self._text[i]["is_data"] or (value_index > len(values) - 1): | |||
if (not self._text[i]["is_data"]) or (value_index > len(values) - 1): |
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.
one more!
if (not self._text[i]["is_data"]) or (value_index > (len(values) - 1)):
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.
Oops, thanks
Updating https://github.com/adafruit/Adafruit_CircuitPython_PortalBase to 1.7.1 from 1.7.0: > Merge pull request adafruit/Adafruit_CircuitPython_PortalBase#40 from makermelissa/main > Moved CI to Python 3.7 > Added help text and problem matcher > Added pull request template
Fixes adafruit/Adafruit_Learning_System_Guides#1553.