Skip to content

Commit

Permalink
run checks for an existing running app
Browse files Browse the repository at this point in the history
  • Loading branch information
bwhitman committed May 29, 2024
1 parent 49c9a83 commit b3047e3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
8 changes: 7 additions & 1 deletion tulip/shared/py/tulip.py
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,13 @@ def run(module_string):
before_run = sys.modules.copy()
before_run_pwd = pwd()

# First, see if we need to delete a running import, for reload
# First, if we're already running, don't run again. Causes some problems
if module_string in running_apps:
# Switch to it
app(module_string)
return

# Second, see if we need to delete a running import, for reload
try:
exec('del sys.modules["%s"]' % (module_string))
except KeyError:
Expand Down
4 changes: 3 additions & 1 deletion tulip/shared/py/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
running_apps = {}
current_app_string = "repl"

uiscreen_load_delay = 50 # milliseconds between section loads


# Returns the keypad indev
def get_keypad_indev():
Expand Down Expand Up @@ -212,7 +214,7 @@ def present(self):
lv.screen_load(self.screen)

for i in range(self.group.get_child_count()):
tulip.defer(unhide, i, 500 + i*100)
tulip.defer(unhide, i, uiscreen_load_delay + i*uiscreen_load_delay)

if(self.handle_keyboard):
get_keypad_indev().set_group(self.kb_group)
Expand Down

0 comments on commit b3047e3

Please sign in to comment.