diff options
author | Walter Bender <walter@walter-laptop.(none)> | 2009-09-07 16:57:55 (GMT) |
---|---|---|
committer | Walter Bender <walter@walter-laptop.(none)> | 2009-09-07 16:57:55 (GMT) |
commit | a379bd436011436a19c6a760d35407270eed5601 (patch) | |
tree | 8ee30446ded11c50ecccbd8a3c98db2d28a2384b | |
parent | 9e632e8665fa3ed3aa2ff279fc71121360830b64 (diff) |
minor code clean up
-rwxr-xr-x | drawwaveform.py | 19 | ||||
-rw-r--r-- | sensor_toolbar.py | 8 | ||||
-rw-r--r-- | sound_toolbar.py | 5 |
3 files changed, 8 insertions, 24 deletions
diff --git a/drawwaveform.py b/drawwaveform.py index 402bc7b..5810a4b 100755 --- a/drawwaveform.py +++ b/drawwaveform.py @@ -204,7 +204,6 @@ class DrawWaveform(gtk.DrawingArea): consecutive points""" return self.draw_interval - def _init_background(self): if self._back_surf: return @@ -248,7 +247,6 @@ class DrawWaveform(gtk.DrawingArea): cr.stroke() - def _expose(self, widget, event): """This function is the "expose" event handler and does all the drawing""" @@ -261,10 +259,9 @@ class DrawWaveform(gtk.DrawingArea): self._init_background() self.window.draw_drawable(self.get_style().bg_gc[0], \ self._back_surf, 0, 0, 0, 0, \ - config.WINDOW_W, config.WINDOW_H) - - #Iterate for each graph - for graph_id in self.graph_id: + config.WINDOW_W, config.WINDOW_H) + #Iterate for each graph + for graph_id in self.graph_id: if self.graph_show_state[graph_id] == True: span = self.Xend[graph_id]-self.Xstart[graph_id] @@ -290,8 +287,6 @@ class DrawWaveform(gtk.DrawingArea): self.y_mag_bias_multiplier = 1 """ Depending upon the X span of the graph, deciding the total number of points to take """ - - else: ############## FFT ############### Fs = 48000 @@ -310,7 +305,7 @@ class DrawWaveform(gtk.DrawingArea): if self.source[graph_id]==0: self.buffers=self.main_buffers else: - pass #write code here that gets data from file + pass #write code here that gets data from file ############################################### ########### Scaling the values ################ @@ -357,7 +352,6 @@ class DrawWaveform(gtk.DrawingArea): else: self.window.draw_points(self._line_gc, lines) ############################################### - """ ## DISPLAYING FRAMERATE FOR DEBUGGGIN @@ -370,7 +364,6 @@ class DrawWaveform(gtk.DrawingArea): """ return True - def set_side_toolbar_reference(self, side_toolbar): self.side_toolbar_copy = side_toolbar @@ -415,7 +408,7 @@ class DrawWaveform(gtk.DrawingArea): color = client.get_string("/desktop/sugar/user/color") except: color = profile.get_color() - stroke = color.get_stroke_color() + stroke,fill = color.split(",") colorstring = stroke.strip() if colorstring[0] == '#': colorstring = colorstring[1:] @@ -433,7 +426,7 @@ class DrawWaveform(gtk.DrawingArea): color = client.get_string("/desktop/sugar/user/color") except: color = profile.get_color() - fill = color.get_fill_color() + stroke,fill = color.split(",") colorstring = fill.strip() if colorstring[0] == '#': colorstring = colorstring[1:] diff --git a/sensor_toolbar.py b/sensor_toolbar.py index 0c8ce7b..3033a1e 100644 --- a/sensor_toolbar.py +++ b/sensor_toolbar.py @@ -141,10 +141,7 @@ class SensorToolbar(gtk.Toolbar): client = gconf.client_get_default() username = client.get_string("/desktop/suagr/user/nick") except: - try: - username = profile.get_nick_name() - except: - username = "Sugar user" + username = profile.get_nick_name() self.ji.start_new_session(username, Xscale, Yscale,\ self.logginginterval_status) self.ag.set_logging_params(True, interval, False) @@ -262,6 +259,3 @@ class SensorToolbar(gtk.Toolbar): if self.wave.get_invert_state()==True: self.string_for_textbox += self._STR3 self.textbox_copy.set_data_params(0, self.string_for_textbox) - - - diff --git a/sound_toolbar.py b/sound_toolbar.py index 127829b..7832e55 100644 --- a/sound_toolbar.py +++ b/sound_toolbar.py @@ -177,10 +177,7 @@ class SoundToolbar(gtk.Toolbar): client = gconf.client_get_default() username = client.get_string("/desktop/suagr/user/nick") except: - try: - username = profile.get_nick_name() - except: - username = "Sugar user" + username = profile.get_nick_name() self.ji.start_new_session(username, Xscale, Yscale,\ self.logginginterval_status) self.ag.set_logging_params(True, interval, True) |