summaryrefslogtreecommitdiff
path: root/decoders/i2s
diff options
context:
space:
mode:
authorUwe Hermann <uwe@hermann-uwe.de>2014-07-15 22:49:43 +0200
committerUwe Hermann <uwe@hermann-uwe.de>2014-07-15 22:49:43 +0200
commit35b380b1156434b73d4a976c68f5ab3604c8510a (patch)
tree75a60785c37d242eee5886af138dba5ef0f177c1 /decoders/i2s
parent22fc7ace72f3165c98208a8f544156e04a709639 (diff)
downloadlibsigrokdecode-35b380b1156434b73d4a976c68f5ab3604c8510a.tar.gz
libsigrokdecode-35b380b1156434b73d4a976c68f5ab3604c8510a.zip
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.
Diffstat (limited to 'decoders/i2s')
-rw-r--r--decoders/i2s/__init__.py1
-rw-r--r--decoders/i2s/pd.py9
2 files changed, 4 insertions, 6 deletions
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
-