mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-23 06:48:16 +00:00
move 'chunks' to trezor.utils
This commit is contained in:
parent
6c0970df9e
commit
6553d315e6
@ -6,11 +6,7 @@ import unittest
|
|||||||
from trezor import loop
|
from trezor import loop
|
||||||
from trezor import msg
|
from trezor import msg
|
||||||
from trezor.wire import read_wire_msg, write_wire_msg
|
from trezor.wire import read_wire_msg, write_wire_msg
|
||||||
|
from trezor.utils import chunks
|
||||||
|
|
||||||
def chunks(l, n):
|
|
||||||
for i in range(0, len(l), n):
|
|
||||||
yield l[i:i + n]
|
|
||||||
|
|
||||||
|
|
||||||
class TestWire(unittest.TestCase):
|
class TestWire(unittest.TestCase):
|
||||||
|
@ -29,3 +29,7 @@ def unimport_gen(gen):
|
|||||||
del sys.modules[to_remove]
|
del sys.modules[to_remove]
|
||||||
return ret
|
return ret
|
||||||
return inner
|
return inner
|
||||||
|
|
||||||
|
def chunks(l, n):
|
||||||
|
for i in range(0, len(l), n):
|
||||||
|
yield l[i:i + n]
|
||||||
|
Loading…
Reference in New Issue
Block a user