From c08c4cd3861c0d5c2b4efda5a2cc7d3a292568ff Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Fri, 3 Jun 2016 16:02:06 +0200 Subject: [PATCH] fix trezor.res --- src/apps/homescreen/layout_homescreen.py | 4 ++-- src/apps/playground/__init__.py | 4 ++-- src/apps/playground_stick/layout_homescreen.py | 4 ++-- src/trezor/res/__init__.py | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/apps/homescreen/layout_homescreen.py b/src/apps/homescreen/layout_homescreen.py index 0959c45640..6ffa081917 100644 --- a/src/apps/homescreen/layout_homescreen.py +++ b/src/apps/homescreen/layout_homescreen.py @@ -1,9 +1,9 @@ from trezor import ui from trezor.ui.swipe import Swipe from trezor.utils import unimport_gen -from trezor.res import loadres from trezor import dispatcher from trezor import loop +from trezor import res from trezor import wire @@ -15,7 +15,7 @@ def swipe_to_rotate(): def animate_logo(): def func(foreground): - ui.display.icon(0, 0, loadres('apps/homescreen/res/trezor.toig'), foreground, ui.BLACK) + ui.display.icon(0, 0, res.load('apps/homescreen/res/trezor.toig'), foreground, ui.BLACK) yield from ui.animate_pulse(func, ui.WHITE, ui.GREY, speed=400000) diff --git a/src/apps/playground/__init__.py b/src/apps/playground/__init__.py index a12c97c5a7..69d78b6fb6 100644 --- a/src/apps/playground/__init__.py +++ b/src/apps/playground/__init__.py @@ -2,7 +2,7 @@ from trezor import loop from trezor import ui from trezor import msg from trezor.utils import unimport_gen -from trezor.res import loadres +from trezor import res @unimport_gen @@ -22,7 +22,7 @@ def layout_tap_to_confirm(address, amount, currency): # def func(fg): # ui.display.text(68, 212, 'TAP TO CONFIRM', style, fg, bg) - # ui.display.icon(3, 170, loadres('apps/playground/res/tap_64.toig'), bg, fg) + # ui.display.icon(3, 170, res.load('apps/playground/res/tap_64.toig'), bg, fg) # animation = ui.animate_pulse(func, ui.BLACK, ui.GREY, speed=200000) diff --git a/src/apps/playground_stick/layout_homescreen.py b/src/apps/playground_stick/layout_homescreen.py index bb5da342aa..4e0d8cd45d 100644 --- a/src/apps/playground_stick/layout_homescreen.py +++ b/src/apps/playground_stick/layout_homescreen.py @@ -1,6 +1,6 @@ from trezor import ui from trezor import loop -from trezor.res import loadres +from trezor import res c = ui.rgbcolor(0x20, 0x98, 0xD1) @@ -12,7 +12,7 @@ def layout_homescreen(): p = 0 def func(foreground): - ui.display.loader(p, c, 0, loadres('apps/playground_stick/res/fingerprint.toig'), foreground) + ui.display.loader(p, c, 0, res.load('apps/playground_stick/res/fingerprint.toig'), foreground) p = (p + 10) % 1000 animation = ui.animate_pulse(func, ui.WHITE, ui.GREY, speed=400000) diff --git a/src/trezor/res/__init__.py b/src/trezor/res/__init__.py index e5677e7472..ce59bb8b58 100644 --- a/src/trezor/res/__init__.py +++ b/src/trezor/res/__init__.py @@ -3,7 +3,7 @@ try: except ImportError: resdata = None -def loadres(name): +def load(name): if resdata and name in resdata: return resdata[name] with open(name, 'rb') as f: