Example #1
0
# boot applications
apps.homescreen.boot()
apps.management.boot()
apps.wallet.boot()
apps.ethereum.boot()
apps.lisk.boot()
apps.nem.boot()
apps.stellar.boot()
apps.ripple.boot()
apps.cardano.boot()
if __debug__:
    apps.debug.boot()
else:
    apps.fido_u2f.boot(usb.iface_u2f)

# initialize the wire codec and start the USB
wire.setup(usb.iface_wire)
if __debug__:
    wire.setup(usb.iface_debug)
usb.bus.open()

# switch into unprivileged mode, as we don't need the extra permissions anymore
utils.set_mode_unprivileged()

# run main event loop and specify which screen is the default
from apps.homescreen.homescreen import homescreen

workflow.startdefault(homescreen)
loop.run()
Example #2
0
# load applications
from apps.common import storage
if __debug__:
    from apps import debug
from apps import homescreen
from apps import management
from apps import wallet
from apps import ethereum
from apps import fido_u2f

# boot applications
if __debug__:
    debug.boot()
homescreen.boot()
management.boot()
wallet.boot()
ethereum.boot()
fido_u2f.boot(usb_u2f)

# initialize the wire codec and start the USB
wire.setup(usb_wire)
usb.open()

# load default homescreen
from apps.homescreen.homescreen import layout_homescreen

# run main even loop and specify which screen is default
workflow.startdefault(layout_homescreen)
loop.run()
Example #3
0
        elif d == SWIPE_LEFT:
            for j in range(4):
                for i in [1, 2, 3]:
                    if self.m[i][j] == self.m[i - 1][j]:
                        self.m[i - 1][j] = self.m[i][j] * 2
                        self.m[i][j] = 0
                    elif 0 == self.m[i - 1][j]:
                        self.m[i - 1][j] = self.m[i][j]
                        self.m[i][j] = 0
        else:  # SWIPE_RIGHT
            for j in range(4):
                for i in [2, 1, 0]:
                    if self.m[i][j] == self.m[i + 1][j]:
                        self.m[i + 1][j] = self.m[i][j] * 2
                        self.m[i][j] = 0
                    elif 0 == self.m[i + 1][j]:
                        self.m[i + 1][j] = self.m[i][j]
                        self.m[i][j] = 0


async def layout_game():
    game = Game()
    while True:
        game.render()
        swipe = await Swipe(absolute=True)
        game.update(swipe)


workflow.startdefault(layout_game)
loop.run()