From: Uwe Hermann Date: Wed, 19 Feb 2014 18:00:36 +0000 (+0100) Subject: sdcard_spi: Use list comprehensions. X-Git-Tag: libsigrokdecode-0.3.0~81 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=3c8031b3f543f82a4a357b4987e0ae6273facfcf;p=libsigrokdecode.git sdcard_spi: Use list comprehensions. --- diff --git a/decoders/sdcard_spi/pd.py b/decoders/sdcard_spi/pd.py index f92be0d..3c25f18 100644 --- a/decoders/sdcard_spi/pd.py +++ b/decoders/sdcard_spi/pd.py @@ -69,12 +69,6 @@ cmd_name = { 51: 'SEND_SCR', } -def ann_cmd_list(): - l = [] - for i in range(63 + 1): - l.append(['cmd%d' % i, 'CMD%d' % i]) - return l - class Decoder(srd.Decoder): api_version = 1 id = 'sdcard_spi' @@ -87,7 +81,8 @@ class Decoder(srd.Decoder): probes = [] optional_probes = [] options = {} - annotations = ann_cmd_list() + [ + annotations = \ + [['cmd%d' % i, 'CMD%d' % i] for i in range(63 + 1)] + [ ['cmd-desc', 'Command description'], ['r1', 'R1 reply'], ['r1b', 'R1B reply'],