[gnome-clocks] Fix some pep8 issues
- From: Paolo Borelli <pborelli src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-clocks] Fix some pep8 issues
- Date: Tue, 21 Aug 2012 07:21:11 +0000 (UTC)
commit d5e365478803b0d60c7314a11c5c5cee99386734
Author: Paolo Borelli <pborelli gnome org>
Date: Tue Aug 21 09:19:32 2012 +0200
Fix some pep8 issues
gnomeclocks/clocks.py | 1 +
gnomeclocks/utils.py | 2 ++
gnomeclocks/widgets.py | 40 +++++++++++++++++++---------------------
3 files changed, 22 insertions(+), 21 deletions(-)
---
diff --git a/gnomeclocks/clocks.py b/gnomeclocks/clocks.py
index 9c8200d..5279553 100644
--- a/gnomeclocks/clocks.py
+++ b/gnomeclocks/clocks.py
@@ -274,6 +274,7 @@ class Alarm(Clock):
self.edit_alarm(alarm)
dialog.destroy()
+
class Stopwatch(Clock):
class State:
diff --git a/gnomeclocks/utils.py b/gnomeclocks/utils.py
index d27db81..0ca5247 100644
--- a/gnomeclocks/utils.py
+++ b/gnomeclocks/utils.py
@@ -21,6 +21,7 @@ import os
from xdg import BaseDirectory
from gi.repository import Gio, Gst, Notify
+
class Dirs:
@staticmethod
def get_data_dir():
@@ -50,6 +51,7 @@ class Dirs:
def get_user_data_dir():
return BaseDirectory.save_data_path("gnome-clocks")
+
class SystemSettings:
@staticmethod
def get_clock_format():
diff --git a/gnomeclocks/widgets.py b/gnomeclocks/widgets.py
index 9b1da5b..f4ba36e 100644
--- a/gnomeclocks/widgets.py
+++ b/gnomeclocks/widgets.py
@@ -541,16 +541,16 @@ class EmptyPlaceholder(Gtk.Box):
class TogglePixbufRenderer(Gtk.CellRendererPixbuf):
__gproperties__ = {
- "active" : (GObject.TYPE_BOOLEAN,
- "Active",
- "Whether the cell renderer is active",
- False,
- GObject.PARAM_READWRITE),
- "toggle-visible" : (GObject.TYPE_BOOLEAN,
- "Toggle visible",
- "Whether to draw the toggle indicator",
- False,
- GObject.PARAM_READWRITE)
+ "active": (GObject.TYPE_BOOLEAN,
+ "Active",
+ "Whether the cell renderer is active",
+ False,
+ GObject.PARAM_READWRITE),
+ "toggle-visible": (GObject.TYPE_BOOLEAN,
+ "Toggle visible",
+ "Whether to draw the toggle indicator",
+ False,
+ GObject.PARAM_READWRITE)
}
def __init__(self):
@@ -572,7 +572,7 @@ class TogglePixbufRenderer(Gtk.CellRendererPixbuf):
icon_size = 40
if direction == Gtk.TextDirection.RTL:
- x_offset = xpad;
+ x_offset = xpad
else:
x_offset = cell_area.width - icon_size - xpad
@@ -620,24 +620,23 @@ class TogglePixbufRenderer(Gtk.CellRendererPixbuf):
class SelectableIconView(Gtk.IconView):
- def __init__(self, model, selection_col, pixbuf_col, text_col = None):
+ def __init__(self, model, selection_col, pixbuf_col, text_col):
Gtk.IconView.__init__(self, model)
self.selection_mode = False
self.selection_col = selection_col
- self.renderer_pixbuf = TogglePixbufRenderer();
+ self.renderer_pixbuf = TogglePixbufRenderer()
self.renderer_pixbuf.set_alignment(0.5, 0.5)
self.pack_start(self.renderer_pixbuf, False)
self.add_attribute(self.renderer_pixbuf, "active", selection_col)
self.add_attribute(self.renderer_pixbuf, "pixbuf", pixbuf_col)
- if text_col:
- renderer_text = Gtk.CellRendererText()
- renderer_text.set_alignment(0.5, 0.5)
- self.pack_start(renderer_text, True)
- self.add_attribute(renderer_text, "markup", text_col)
+ renderer_text = Gtk.CellRendererText()
+ renderer_text.set_alignment(0.5, 0.5)
+ self.pack_start(renderer_text, True)
+ self.add_attribute(renderer_text, "markup", text_col)
def get_selection(self):
selection = []
@@ -658,8 +657,8 @@ class SelectableIconView(Gtk.IconView):
# FIXME: override both button press and release to check
# that a specfic item is clicked? see libgd...
- def do_button_press_event (self, event):
- path = self.get_path_at_pos(event.x, event.y);
+ def do_button_press_event(self, event):
+ path = self.get_path_at_pos(event.x, event.y)
if path:
if self.selection_mode:
@@ -672,4 +671,3 @@ class SelectableIconView(Gtk.IconView):
self.emit("item-activated", path)
return False
-
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]