1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-23 14:58:09 +00:00

import qualified const()

This commit is contained in:
Jan Pochyla 2016-09-29 12:29:43 +02:00
parent c9fbac7a0b
commit 407169af01
16 changed files with 27 additions and 14 deletions

View File

@ -1,3 +1,4 @@
from micropython import const
from trezor import config from trezor import config
@ -14,4 +15,4 @@ def set_storage(session_id, buf):
def clear_storage(session_id): def clear_storage(session_id):
set_storage(session_id, '') set_storage(session_id, b'')

View File

@ -1,3 +1,4 @@
from micropython import const
from trezor import wire, ui from trezor import wire, ui
from trezor.utils import unimport, chunks from trezor.utils import unimport, chunks

View File

@ -10,6 +10,8 @@ Value format: ((field_type, field_flags, field_name), field_value)
field_value: Depends on field_type. EmbeddedMessage has `field_value == None`. field_value: Depends on field_type. EmbeddedMessage has `field_value == None`.
''' '''
from micropython import const
def build_protobuf_message(message_type, callback, *args): def build_protobuf_message(message_type, callback, *args):
message = message_type() message = message_type()

View File

@ -1,3 +1,5 @@
from micropython import const
if not __debug__: if not __debug__:
raise ImportError('This module can be loaded only in DEBUG mode') raise ImportError('This module can be loaded only in DEBUG mode')

View File

@ -1,3 +1,4 @@
from micropython import const
import uio import uio
import sys import sys
import utime import utime

View File

@ -1,5 +1,5 @@
import utime import utime
from micropython import const
from uheapq import heappop, heappush, heapify from uheapq import heappop, heappush, heapify
from .utils import type_gen from .utils import type_gen
from . import msg from . import msg

View File

@ -1,5 +1,6 @@
from . import display, in_area, rotate_coords from micropython import const
from trezor import ui, loop from trezor import ui, loop
from . import display, in_area, rotate_coords
DEFAULT_BUTTON = { DEFAULT_BUTTON = {

View File

@ -1,8 +1,9 @@
from micropython import const
from trezor import loop
from .button import Button, BTN_CLICKED, BTN_STARTED from .button import Button, BTN_CLICKED, BTN_STARTED
from .button import CONFIRM_BUTTON, CONFIRM_BUTTON_ACTIVE from .button import CONFIRM_BUTTON, CONFIRM_BUTTON_ACTIVE
from .button import CANCEL_BUTTON, CANCEL_BUTTON_ACTIVE from .button import CANCEL_BUTTON, CANCEL_BUTTON_ACTIVE
from .loader import Loader from .loader import Loader
from trezor import loop
CONFIRMED = const(1) CONFIRMED = const(1)

View File

@ -1,4 +1,5 @@
import utime import utime
from micropython import const
from trezor import ui from trezor import ui

View File

@ -1,7 +1,8 @@
from . import display from micropython import const
from .button import Button, BTN_CLICKED, CLEAR_BUTTON, CLEAR_BUTTON_ACTIVE
from trezor import ui, res
from trezor.crypto import random from trezor.crypto import random
from trezor import ui, res
from .button import Button, BTN_CLICKED, CLEAR_BUTTON, CLEAR_BUTTON_ACTIVE
from . import display
def digit_area(i): def digit_area(i):

View File

@ -1,5 +1,6 @@
from .swipe import Swipe, SWIPE_UP, SWIPE_DOWN from micropython import const
from trezor import loop, ui from trezor import loop, ui
from .swipe import Swipe, SWIPE_UP, SWIPE_DOWN
async def change_page(page, page_count): async def change_page(page, page_count):

View File

@ -1,7 +1,7 @@
import utime import utime
from micropython import const
from . import in_area, rotate_coords
from trezor import loop from trezor import loop
from . import in_area, rotate_coords
SWIPE_DISTANCE_THRESHOLD = const(20) # Min pixels in the primary direction SWIPE_DISTANCE_THRESHOLD = const(20) # Min pixels in the primary direction

View File

@ -1,3 +1,4 @@
from micropython import const
from trezor import ui from trezor import ui
TEXT_HEADER_HEIGHT = const(44) TEXT_HEADER_HEIGHT = const(44)

View File

@ -1,3 +1,4 @@
from micropython import const
import ustruct import ustruct
import ubinascii import ubinascii

View File

@ -1,3 +1,4 @@
from micropython import const
import ustruct import ustruct
SESSION_V1 = const(0) SESSION_V1 = const(0)

View File

@ -1,8 +1,6 @@
import ubinascii import ubinascii
from micropython import const
from trezor import msg from trezor import msg, loop, log
from trezor import loop
from trezor import log
_DEFAULT_IFACE = const(0) _DEFAULT_IFACE = const(0)