1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-22 22:38:08 +00:00

move 'chunks' to trezor.utils

This commit is contained in:
Jan Pochyla 2016-06-09 16:31:53 +02:00 committed by Pavol Rusnak
parent 6c0970df9e
commit 6553d315e6
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D
2 changed files with 5 additions and 5 deletions

View File

@ -6,11 +6,7 @@ import unittest
from trezor import loop
from trezor import msg
from trezor.wire import read_wire_msg, write_wire_msg
def chunks(l, n):
for i in range(0, len(l), n):
yield l[i:i + n]
from trezor.utils import chunks
class TestWire(unittest.TestCase):

View File

@ -29,3 +29,7 @@ def unimport_gen(gen):
del sys.modules[to_remove]
return ret
return inner
def chunks(l, n):
for i in range(0, len(l), n):
yield l[i:i + n]