From 6c03cdc2c28638332f779507ba862ee24979c791 Mon Sep 17 00:00:00 2001 From: andreamah Date: Wed, 8 Apr 2020 16:57:06 -0700 Subject: [PATCH 1/2] fixed bug bash issues --- src/base_circuitpython/board.py | 4 ++-- src/base_circuitpython/displayio/group.py | 2 +- src/clue/adafruit_slideshow.py | 17 ++++++++--------- src/common/debugger_communication_client.py | 4 ++++ 4 files changed, 15 insertions(+), 12 deletions(-) diff --git a/src/base_circuitpython/board.py b/src/base_circuitpython/board.py index 92f501408..8bef9ed4f 100644 --- a/src/base_circuitpython/board.py +++ b/src/base_circuitpython/board.py @@ -5,7 +5,7 @@ import terminal_handler -class Display: +class __Display: def __init__(self): self.active_group = None self.terminal = terminal_handler.Terminal() @@ -25,7 +25,7 @@ def show(self, group=None): group._Group__draw() -DISPLAY = Display() +DISPLAY = __Display() # default pin for neopixel, # shows that this could diff --git a/src/base_circuitpython/displayio/group.py b/src/base_circuitpython/displayio/group.py index edae6f3e2..05efc5ffb 100644 --- a/src/base_circuitpython/displayio/group.py +++ b/src/base_circuitpython/displayio/group.py @@ -305,5 +305,5 @@ def __len__(self): def pop(self, i=-1): item = self.__contents.pop(i) item.parent = None - self.elem_changed() + self.__elem_changed() return item diff --git a/src/clue/adafruit_slideshow.py b/src/clue/adafruit_slideshow.py index f99a2647b..7e5cecd2c 100644 --- a/src/clue/adafruit_slideshow.py +++ b/src/clue/adafruit_slideshow.py @@ -7,10 +7,7 @@ import time import collections from random import shuffle -from common import utils -from common import debugger_communication_client -from common.telemetry import telemetry_py -from common.telemetry_events import TelemetryEvent +import common import board # taken from adafruit @@ -157,7 +154,7 @@ def __init__( # if path is relative, this makes sure that # it's relative to the users's code file abs_path_parent_dir = os.path.abspath( - os.path.join(utils.abs_path_to_user_file, os.pardir) + os.path.join(common.utils.abs_path_to_user_file, os.pardir) ) abs_path_folder = os.path.normpath(os.path.join(abs_path_parent_dir, folder)) @@ -176,7 +173,9 @@ def __init__( # show the first working image self.advance() - telemetry_py.send_telemetry(TelemetryEvent.CLUE_API_SLIDESHOW) + common.telemetry.telemetry_py.send_telemetry( + common.telemetry.TelemetryEvent.CLUE_API_SLIDESHOW + ) @property def current_image_name(self): @@ -382,9 +381,9 @@ def __send(self, img): sendable_json = {CONSTANTS.BASE_64: img_str} - if utils.debug_mode: - debugger_communication_client.debug_send_to_simulator( + if common.utils.debug_mode: + common.debugger_communication_client.debug_send_to_simulator( sendable_json, CONSTANTS.CLUE ) else: - utils.send_to_simulator(sendable_json, CONSTANTS.CLUE) + common.utils.send_to_simulator(sendable_json, CONSTANTS.CLUE) diff --git a/src/common/debugger_communication_client.py b/src/common/debugger_communication_client.py index 11273f053..440301a1a 100644 --- a/src/common/debugger_communication_client.py +++ b/src/common/debugger_communication_client.py @@ -3,7 +3,11 @@ import sys import json + +# WARNING: importing socketio will sometimes cause errors in normat execution +# try to import common instead of common.debugger_communication_cleint import socketio + import copy import pathlib From 0a15fd2bb2a8a7b82be87e1522b94d581427dd57 Mon Sep 17 00:00:00 2001 From: andreamah Date: Wed, 8 Apr 2020 17:09:43 -0700 Subject: [PATCH 2/2] fixed typo --- src/common/debugger_communication_client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/debugger_communication_client.py b/src/common/debugger_communication_client.py index 440301a1a..08db21b89 100644 --- a/src/common/debugger_communication_client.py +++ b/src/common/debugger_communication_client.py @@ -4,7 +4,7 @@ import sys import json -# WARNING: importing socketio will sometimes cause errors in normat execution +# WARNING: importing socketio will sometimes cause errors in normal execution # try to import common instead of common.debugger_communication_cleint import socketio