diff options
author | Walter Bender <walter.bender@gmail.com> | 2012-06-25 19:44:00 (GMT) |
---|---|---|
committer | Walter Bender <walter.bender@gmail.com> | 2012-06-25 19:44:00 (GMT) |
commit | 50ad403a12f827d05d3dfba623fae6a851ee5af5 (patch) | |
tree | df56a7f477d6cb140653a150aa51f47c71f35974 | |
parent | 0e217e28434dd6cb8c76b2ebb59d0f7a71d8366b (diff) |
pep8 cleanup
-rw-r--r-- | audiograb.py | 2 | ||||
-rw-r--r-- | drawwaveform.py | 11 | ||||
-rw-r--r-- | sensor_toolbar.py | 1 | ||||
-rw-r--r-- | tuning_toolbar.py | 8 |
4 files changed, 10 insertions, 12 deletions
diff --git a/audiograb.py b/audiograb.py index 5f72543..e255828 100644 --- a/audiograb.py +++ b/audiograb.py @@ -345,7 +345,7 @@ class AudioGrab(): '''Sends the data for logging''' if not self._busy: self._busy = True - if self._take_screenshot: + if self._take_screenshot: if self.activity.data_logger.take_screenshot( self._image_counter): self._image_counter += 1 diff --git a/drawwaveform.py b/drawwaveform.py index 1e97039..8665d21 100644 --- a/drawwaveform.py +++ b/drawwaveform.py @@ -44,7 +44,6 @@ class DrawWaveform(gtk.DrawingArea): COLORS = ['#B20008', '#00588C', '#F8E800', '#7F00BF', '#4BFF3A', '#FFA109', '#00A0FF', '#BCCEFF', '#008009', '#F8E800', '#AC32FF', '#FFFFFF'] - def __init__(self, activity, input_frequency=RATE, channels=1): """ Initialize drawing area and scope parameter """ gtk.DrawingArea.__init__(self) @@ -563,12 +562,13 @@ class DrawWaveform(gtk.DrawingArea): self.draw_interval = 5.0 - self.set_max_samples(ceil(self.allocation.width\ - / float(self.draw_interval) * 2) * self.input_step) + self.set_max_samples( + ceil(self.allocation.width / \ + float(self.draw_interval) * 2) * self.input_step) # Create the (blackman) window - self.fft_window = blackman(ceil(self.allocation.width\ - / float(self.draw_interval) * 2)) + self.fft_window = blackman( + ceil(self.allocation.width / float(self.draw_interval) * 2)) self.draw_interval *= wanted_step / self.input_step else: @@ -611,4 +611,3 @@ class DrawWaveform(gtk.DrawingArea): def get_visibility(self, channel=0): return self.visibility[channel] - diff --git a/sensor_toolbar.py b/sensor_toolbar.py index a3ec822..c594b6a 100644 --- a/sensor_toolbar.py +++ b/sensor_toolbar.py @@ -434,4 +434,3 @@ of XO)") + ' ' if invert: string_for_textbox += self.STR_INVERT self.activity.text_box.set_label(string_for_textbox) - diff --git a/tuning_toolbar.py b/tuning_toolbar.py index b0b99f4..4c67fe9 100644 --- a/tuning_toolbar.py +++ b/tuning_toolbar.py @@ -17,7 +17,7 @@ import gobject import subprocess from gettext import gettext as _ -from config import ICONS_DIR, CAPTURE_GAIN, MIC_BOOST, XO1, XO15, XO175, XO30, \ +from config import ICONS_DIR, CAPTURE_GAIN, MIC_BOOST, XO1, XO15, XO175, XO30,\ INSTRUMENT_DICT from sugar.graphics.toolbutton import ToolButton @@ -82,7 +82,7 @@ class TuningToolbar(gtk.Toolbar): self._notes_combo.append_item( n, note_octave(i, octave), None) n += 1 - self._notes_combo.set_active(48) # A4 + self._notes_combo.set_active(48) # A4 self._notes_changed_id = self._notes_combo.connect( 'changed', self.update_note) if hasattr(self._notes_combo, 'set_tooltip_text'): @@ -347,7 +347,7 @@ class InstrumentToolbar(gtk.Toolbar): self._notes_combo.append_item( n, note_octave(i, octave), None) n += 1 - self._notes_combo.set_active(48) # A4 + self._notes_combo.set_active(48) # A4 if hasattr(self._notes_combo, 'set_tooltip_text'): self._notes_combo.set_tooltip_text(_('Notes')) self._notes_tool = ToolComboBox(self._notes_combo) @@ -430,4 +430,4 @@ def index_to_octave(i): def index_to_note(i): - return (i-3) % 12 # -3 because we start with A + return (i - 3) % 12 # -3 because we start with A |