From 35b380b1156434b73d4a976c68f5ab3604c8510a Mon Sep 17 00:00:00 2001 From: Uwe Hermann Date: Tue, 15 Jul 2014 22:49:43 +0200 Subject: All PDs: Minor whitespace and consistency fixes. - No newlines at the end of files. - No trailing ';' characters. - Comparison with None: Use 'is None' or 'is not None'. - Comparison with True/False: Use 'if cond:' or 'if not cond:'. - Various minor whitespace fixes. --- decoders/guess_bitrate/__init__.py | 1 - decoders/guess_bitrate/pd.py | 9 ++++----- 2 files changed, 4 insertions(+), 6 deletions(-) (limited to 'decoders/guess_bitrate') diff --git a/decoders/guess_bitrate/__init__.py b/decoders/guess_bitrate/__init__.py index 9c7e6a4..1b41f72 100644 --- a/decoders/guess_bitrate/__init__.py +++ b/decoders/guess_bitrate/__init__.py @@ -35,4 +35,3 @@ the expected bitrate/baudrate that might be used on the channel. ''' from .pd import * - diff --git a/decoders/guess_bitrate/pd.py b/decoders/guess_bitrate/pd.py index 1d7434b..250d519 100644 --- a/decoders/guess_bitrate/pd.py +++ b/decoders/guess_bitrate/pd.py @@ -53,7 +53,7 @@ class Decoder(srd.Decoder): def metadata(self, key, value): if key == srd.SRD_CONF_SAMPLERATE: - self.samplerate = value; + self.samplerate = value def decode(self, ss, es, data): if not self.samplerate: @@ -67,22 +67,21 @@ class Decoder(srd.Decoder): continue # Initialize first self.olddata with the first sample value. - if self.olddata == None: + if self.olddata is None: self.olddata = data continue # Get the smallest distance between two transitions # and use that to calculate the bitrate/baudrate. - if self.first_transition == True: + if self.first_transition: self.ss_edge = self.samplenum self.first_transition = False else: b = self.samplenum - self.ss_edge - if self.bitwidth == None or b < self.bitwidth: + if self.bitwidth is None or b < self.bitwidth: self.bitwidth = b bitrate = int(float(self.samplerate) / float(b)) self.putx([0, ['%d' % bitrate]]) self.ss_edge = self.samplenum self.olddata = data - -- cgit v1.2.3-70-g09d2