Skip to content

remove broken ip address print during debug #6

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

Merged
merged 2 commits into from
Nov 14, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions adafruit_magtag/magtag.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,10 @@ def set_text(self, val, index=0, auto_refresh=True):
self.add_text()
string = str(val)
if self._text_maxlen[index]:
string = string[: self._text_maxlen[index]]
if len(string) > self._text_maxlen[index]:
# too long! shorten it
string = string[: self._text_maxlen[index] - 3]
string += "..."
print("text index", self._text[index])
index_in_splash = None

Expand Down Expand Up @@ -350,7 +353,7 @@ def fetch(self, refresh_url=None, timeout=10):
print("Drawing text", string)
if self._text_wrap[i]:
if self._debug:
print("Wrapping text")
print("Wrapping text with length of", self._text_wrap[i])
lines = self.wrap_nicely(string, self._text_wrap[i])
string = "\n".join(lines)
self.set_text(string, index=i, auto_refresh=False)
Expand Down Expand Up @@ -396,8 +399,8 @@ def url(self, value):
self._url = value
if value and not self.network.uselocal:
self.network.connect()
if self._debug:
print("My IP address is", self.network.ip_address)
# if self._debug:
# print("My IP address is", self.network.ip_address)

@property
def json_path(self):
Expand Down