Skip to content

Commit 397f139

Browse files
authored
Merge pull request #6 from ladyada/main
remove broken ip address print during debug
2 parents af1a21f + f9a478a commit 397f139

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

adafruit_magtag/magtag.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,10 @@ def set_text(self, val, index=0, auto_refresh=True):
236236
self.add_text()
237237
string = str(val)
238238
if self._text_maxlen[index]:
239-
string = string[: self._text_maxlen[index]]
239+
if len(string) > self._text_maxlen[index]:
240+
# too long! shorten it
241+
string = string[: self._text_maxlen[index] - 3]
242+
string += "..."
240243
print("text index", self._text[index])
241244
index_in_splash = None
242245

@@ -351,7 +354,7 @@ def fetch(self, refresh_url=None, timeout=10):
351354
print("Drawing text", string)
352355
if self._text_wrap[i]:
353356
if self._debug:
354-
print("Wrapping text")
357+
print("Wrapping text with length of", self._text_wrap[i])
355358
lines = self.wrap_nicely(string, self._text_wrap[i])
356359
string = "\n".join(lines)
357360
self.set_text(string, index=i, auto_refresh=False)
@@ -397,8 +400,8 @@ def url(self, value):
397400
self._url = value
398401
if value and not self.network.uselocal:
399402
self.network.connect()
400-
if self._debug:
401-
print("My IP address is", self.network.ip_address)
403+
# if self._debug:
404+
# print("My IP address is", self.network.ip_address)
402405

403406
@property
404407
def json_path(self):

0 commit comments

Comments
 (0)