Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _reset(self):
self.reset()
raise NextScene()
def internal_checks(screen):
# Check for exit
for char in ("X", "x", "Q", "q"):
with self.assertRaises(StopApplication):
event = KeyboardEvent(ord(char))
screen._unhandled_event_default(event)
for char in (" ", "\n"):
with self.assertRaises(NextScene):
event = KeyboardEvent(ord(char))
screen._unhandled_event_default(event)
def test_on_click(selection):
raise NextScene(str(selection))
for effect in scene.effects:
# Update the effect and delete if needed.
effect.update(self._frame)
if effect.delete_count is not None:
effect.delete_count -= 1
if effect.delete_count <= 0:
scene.remove_effect(effect)
# Sort out when we next _need_ to do a refresh.
if effect.frame_update_count > 0:
self._idle_frame_count = min(self._idle_frame_count,
effect.frame_update_count)
self.refresh()
if 0 < scene.duration <= self._frame:
raise NextScene()
except NextScene as e:
# Tidy up the current scene.
scene.exit()
# Find the specified next Scene
if e.name is None:
# Just allow next iteration of loop
self._scene_index += 1
if self._scene_index >= len(self._scenes):
if repeat:
self._scene_index = 0
else:
raise StopApplication("Repeat disabled")
else:
# Find the required scene.
for i, scene in enumerate(self._scenes):
def _cancel(self):
self._scene.remove_effect(self)
raise NextScene(self._scene.name)
#raise NextScene("Main")
Credstick.interface = self._interface
Credstick.eth_node = self._interface._node
Credstick.config = self._interface._config
Credstick.start_detect_thread()
self.detect_thread_started = True
if self._interface.credstick and self._interface.node.w3 and self._interface._credstick_inserted == True:
logging.debug("credstick found - Switching to Main scene")
# deleting the loading scene entirely.
# This makes sure the loading screen does not come back upon resize.
#self._screen._scenes = [self._interface.main_scene]
#self._interface._loading_scene = False
self._interface._credstick_inserted = False
raise NextScene("Main")
def close(self):
# deregister from new_block callbacks
self.dapp.remove_block_listener(self)
self._destroy_window_stack()
raise NextScene(self._scene.name)
def _ok(self):
self.save()
self._model.update_current_contact(self.data)
raise NextScene("Main")
def _reset(self):
self.reset()
raise NextScene()
def _add(self):
self._model.current_id = None
raise NextScene("Edit Contact")