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/i2s/__init__.py | 1 - decoders/i2s/pd.py | 9 ++++----- 2 files changed, 4 insertions(+), 6 deletions(-) (limited to 'decoders/i2s') diff --git a/decoders/i2s/__init__.py b/decoders/i2s/__init__.py index b9c0ed7..550a8c8 100644 --- a/decoders/i2s/__init__.py +++ b/decoders/i2s/__init__.py @@ -28,4 +28,3 @@ http://en.wikipedia.org/wiki/I2s ''' from .pd import * - diff --git a/decoders/i2s/pd.py b/decoders/i2s/pd.py index dc42a4e..8b45a75 100644 --- a/decoders/i2s/pd.py +++ b/decoders/i2s/pd.py @@ -93,8 +93,8 @@ class Decoder(srd.Decoder): # Calculate the sample rate. samplerate = '?' - if self.start_sample != None and \ - self.first_sample != None and \ + if self.start_sample is not None and \ + self.first_sample is not None and \ self.start_sample > self.first_sample: samplerate = '%d' % (self.samplesreceived * self.samplerate / (self.start_sample - @@ -151,7 +151,7 @@ class Decoder(srd.Decoder): continue # Only submit the sample, if we received the beginning of it. - if self.start_sample != None: + if self.start_sample is not None: if not self.wrote_wav_header: self.put(0, 0, self.out_bin, (0, self.wav_header())) @@ -182,8 +182,7 @@ class Decoder(srd.Decoder): self.start_sample = self.samplenum # Save the first sample position. - if self.first_sample == None: + if self.first_sample is None: self.first_sample = self.samplenum self.oldws = ws - -- cgit v1.2.3-70-g09d2