From: Uwe Hermann Date: Tue, 10 Jan 2012 21:12:46 +0000 (+0100) Subject: srd: Drop useless out_ann/out_proto init. X-Git-Tag: libsigrokdecode-0.1.0~177 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=d0e93c76e381eff58ca23949301f781b24ba4a8b;p=libsigrokdecode.git srd: Drop useless out_ann/out_proto init. If those variables are used before start() was called, that's a bug anyway. --- diff --git a/decoders/i2c.py b/decoders/i2c.py index 6982798..b8c56f7 100644 --- a/decoders/i2c.py +++ b/decoders/i2c.py @@ -149,8 +149,6 @@ class Decoder(srd.Decoder): ] def __init__(self, **kwargs): - self.out_proto = None - self.out_ann = None self.samplecnt = 0 self.bitcount = 0 self.databyte = 0 diff --git a/decoders/mx25lxx05d.py b/decoders/mx25lxx05d.py index 72e1e1b..4a87fa4 100644 --- a/decoders/mx25lxx05d.py +++ b/decoders/mx25lxx05d.py @@ -172,8 +172,6 @@ class Decoder(srd.Decoder): options = {} # TODO def __init__(self, **kwargs): - self.out_proto = None - self.out_ann = None self.state = IDLE self.cmdstate = 1 # TODO self.out = [] diff --git a/decoders/nunchuk.py b/decoders/nunchuk.py index 009459d..86ec171 100644 --- a/decoders/nunchuk.py +++ b/decoders/nunchuk.py @@ -77,9 +77,6 @@ class Decoder(srd.Decoder): options = {} def __init__(self, **kwargs): - self.out_proto = None - self.out_ann = None - self.state = IDLE # TODO: Can we assume a certain initial state? self.sx = self.sy = self.ax = self.ay = self.az = self.bz = self.bc = 0 diff --git a/decoders/pan1321.py b/decoders/pan1321.py index 441cba0..2d86679 100644 --- a/decoders/pan1321.py +++ b/decoders/pan1321.py @@ -51,8 +51,6 @@ class Decoder(srd.Decoder): ] def __init__(self, **kwargs): - # self.out_proto = None - self.out_ann = None self.cmd = '' def start(self, metadata): diff --git a/decoders/spi.py b/decoders/spi.py index 5529025..9d3940e 100644 --- a/decoders/spi.py +++ b/decoders/spi.py @@ -42,8 +42,6 @@ class Decoder(srd.Decoder): self.rxcount = 0 self.rxdata = 0 self.bytesreceived = 0 - self.out_proto = None - self.out_ann = None def start(self, metadata): # self.out_proto = self.add(srd.SRD_OUTPUT_PROTO, 'spi') diff --git a/decoders/srd_usb.py b/decoders/srd_usb.py index 842cf03..c6e6627 100644 --- a/decoders/srd_usb.py +++ b/decoders/srd_usb.py @@ -118,8 +118,7 @@ class Decoder(srd.Decoder): options = {} def __init__(self): - self.out_proto = None - self.out_ann = None + pass def start(self, metadata): self.rate = metadata['samplerate'] diff --git a/decoders/transitioncounter.py b/decoders/transitioncounter.py index eaf8738..6092258 100644 --- a/decoders/transitioncounter.py +++ b/decoders/transitioncounter.py @@ -36,8 +36,6 @@ class Decoder(srd.Decoder): options = {} def __init__(self, **kwargs): - self.out_proto = None - self.out_ann = None self.channels = -1 self.lastsample = None diff --git a/decoders/uart.py b/decoders/uart.py index c3a90ef..4546521 100644 --- a/decoders/uart.py +++ b/decoders/uart.py @@ -231,9 +231,6 @@ class Decoder(srd.Decoder): ] def __init__(self, **kwargs): - self.out_proto = None - self.out_ann = None - # Set defaults, can be overridden in 'start'. self.baudrate = 115200 self.num_data_bits = 8