[gnome-clocks/gnome-3-6] Fix pep8/pyflakes warnings



commit 8e75a47c7a7cac867a5acd826088cd127f84a297
Author: Paolo Borelli <pborelli gnome org>
Date:   Mon Dec 3 21:22:39 2012 +0100

    Fix pep8/pyflakes warnings

 gnomeclocks/__init__.py  |    8 ++++----
 gnomeclocks/alarm.py     |    9 +++------
 gnomeclocks/app.py       |    9 ++++-----
 gnomeclocks/stopwatch.py |    2 +-
 gnomeclocks/timer.py     |    2 +-
 gnomeclocks/utils.py     |    7 ++++---
 gnomeclocks/widgets.py   |    8 +++-----
 gnomeclocks/world.py     |    7 ++-----
 8 files changed, 22 insertions(+), 30 deletions(-)
---
diff --git a/gnomeclocks/__init__.py b/gnomeclocks/__init__.py
index 0a374c1..f659bae 100644
--- a/gnomeclocks/__init__.py
+++ b/gnomeclocks/__init__.py
@@ -36,7 +36,7 @@ AUTHORS = [
     "Volker Sobek"
 ]
 
-COPYRIGHTS =\
-"""2011 Â Collabora Ltd.
-   2012 Â Collabora Ltd., Seif Lotfy
-          Emily Gonyer, Eslam Mostafa, Paolo Borelli"""
+COPYRIGHTS = \
+    """2011 Â Collabora Ltd.
+       2012 Â Collabora Ltd., Seif Lotfy
+              Emily Gonyer, Eslam Mostafa, Paolo Borelli"""
diff --git a/gnomeclocks/alarm.py b/gnomeclocks/alarm.py
index 2b59c88..f5ced56 100644
--- a/gnomeclocks/alarm.py
+++ b/gnomeclocks/alarm.py
@@ -18,10 +18,9 @@
 
 import os
 import errno
-import time
 import json
 from datetime import timedelta
-from gi.repository import GLib, GObject, Gdk, GdkPixbuf, Gtk
+from gi.repository import GLib, GObject, GdkPixbuf, Gtk
 from clocks import Clock
 from utils import Alert, Dirs, LocalizedWeekdays, SystemSettings, TimeString, WallClock
 from widgets import SelectableIconView, ContentView
@@ -77,7 +76,7 @@ class AlarmItem:
         self.name = name
         self.hour = hour
         self.minute = minute
-        self.days = days # list of numbers, 0 == Monday
+        self.days = days  # list of numbers, 0 == Monday
 
         self._update_expiration_time()
         self._reset_snooze(self.alarm_time)
@@ -482,9 +481,7 @@ class Alarm(Clock):
 
     def _add_alarm_item(self, alarm):
         label = GLib.markup_escape_text(alarm.name)
-        view_iter = self.liststore.append([False,
-                                           "<b>%s</b>" % label,
-                                           alarm])
+        self.liststore.append([False, "<b>%s</b>" % label, alarm])
         self.notify("can-select")
 
     def update_alarm(self, old_alarm, new_alarm):
diff --git a/gnomeclocks/app.py b/gnomeclocks/app.py
index ac80464..94b3e19 100644
--- a/gnomeclocks/app.py
+++ b/gnomeclocks/app.py
@@ -19,7 +19,7 @@
 import os
 import sys
 from gettext import ngettext
-from gi.repository import Gtk, Gdk, GObject, GLib, Gio, GtkClutter
+from gi.repository import Gtk, Gdk, GObject, Gio, GtkClutter
 from clocks import Clock
 from world import World
 from alarm import Alarm
@@ -50,9 +50,8 @@ class Window(Gtk.ApplicationWindow):
                                                  "gtk-style.css"))
         context = Gtk.StyleContext()
         context.add_provider_for_screen(Gdk.Screen.get_default(),
-                                         css_provider,
-                                         Gtk.STYLE_PROVIDER_PRIORITY_USER)
-
+                                        css_provider,
+                                        Gtk.STYLE_PROVIDER_PRIORITY_USER)
 
         self.set_size_request(640, 480)
 
@@ -199,7 +198,7 @@ class ClockButton(Gtk.RadioButton):
             self.remove(label)
             # We need to unset the flag manually until GTK fixes
             # https://bugzilla.gnome.org/show_bug.cgi?id=688519
-            label.unset_state_flags (Gtk.StateFlags.ACTIVE)
+            label.unset_state_flags(Gtk.StateFlags.ACTIVE)
             if self.get_active():
                 self.add(self.bold_label)
             else:
diff --git a/gnomeclocks/stopwatch.py b/gnomeclocks/stopwatch.py
index bbc4627..e1fb0de 100644
--- a/gnomeclocks/stopwatch.py
+++ b/gnomeclocks/stopwatch.py
@@ -108,7 +108,7 @@ class Stopwatch(Clock):
         scroll = Gtk.ScrolledWindow()
         scroll.get_style_context().add_class("clocks-laps-scroll")
         scroll.set_shadow_type(Gtk.ShadowType.IN)
-        scroll.set_vexpand(True);
+        scroll.set_vexpand(True)
         scroll.add(self.laps_view)
         vbox.pack_start(scroll, True, True, 0)
 
diff --git a/gnomeclocks/timer.py b/gnomeclocks/timer.py
index ffb25ba..e557b88 100644
--- a/gnomeclocks/timer.py
+++ b/gnomeclocks/timer.py
@@ -165,7 +165,7 @@ class Timer(Clock):
         self.add(self.notebook)
 
         # force the time label and the spinner to the same size
-        size_group = Gtk.SizeGroup(Gtk.SizeGroupMode.VERTICAL);
+        size_group = Gtk.SizeGroup(Gtk.SizeGroupMode.VERTICAL)
 
         self.setup_screen = TimerSetupScreen(self, size_group)
         self.notebook.append_page(self.setup_screen, None)
diff --git a/gnomeclocks/utils.py b/gnomeclocks/utils.py
index 39716ae..20beeb9 100644
--- a/gnomeclocks/utils.py
+++ b/gnomeclocks/utils.py
@@ -24,7 +24,8 @@ from xdg import BaseDirectory
 from gi.repository import GObject, Gio, GnomeDesktop, Notify
 
 
-def N_(message): return message
+def N_(message):
+    return message
 
 
 class Dirs:
@@ -118,7 +119,7 @@ class LocalizedWeekdays:
     # based on code from hamster-applet
     # pretty ugly, but it seems this is the only way
     # note that we use the convention used by struct_time.tm_wday
-    # which is 0 = Monday, note the one used by strftime("%w")
+    # which is 0 = Monday, not the one used by strftime("%w")
     @staticmethod
     def first_weekday():
         try:
@@ -138,7 +139,7 @@ class WallClock(GObject.GObject):
 
     def __init__(self):
         if WallClock._instance:
-           raise TypeError("Initialized twice")
+            raise TypeError("Initialized twice")
         GObject.GObject.__init__(self)
         self._wc = GnomeDesktop.WallClock()
         self._wc.connect("notify::clock", self._on_notify_clock)
diff --git a/gnomeclocks/widgets.py b/gnomeclocks/widgets.py
index 20598ac..7174667 100644
--- a/gnomeclocks/widgets.py
+++ b/gnomeclocks/widgets.py
@@ -16,10 +16,8 @@
 #
 # Author: Seif Lotfy <seif lotfy collabora co uk>
 
-import cairo
-from gi.repository import GObject, Gio, Gtk, Gdk, Pango, PangoCairo
+from gi.repository import GObject, Gio, Gtk, Gdk, Pango
 from gi.repository import Clutter, GtkClutter
-from math import pi as PI
 
 
 class Spinner(Gtk.SpinButton):
@@ -158,7 +156,6 @@ class DigitalClockRenderer(Gtk.CellRendererPixbuf):
 
         cr.restore()
 
-
     def do_get_size(self, widget, cell_area):
         x_offset, y_offset, width, height = Gtk.CellRendererPixbuf.do_get_size(self, widget, cell_area)
         width += self.icon_size // 4
@@ -344,7 +341,8 @@ class Embed(GtkClutter.Embed):
         self._contentsActor = Clutter.Box()
         self._contentsActor.set_layout_manager(self._contentsLayout)
         self._overlayLayout.add(self._contentsActor,
-            Clutter.BinAlignment.FILL, Clutter.BinAlignment.FILL)
+                                Clutter.BinAlignment.FILL,
+                                Clutter.BinAlignment.FILL)
 
         self._viewLayout = Clutter.BinLayout()
         self._viewActor = Clutter.Box()
diff --git a/gnomeclocks/world.py b/gnomeclocks/world.py
index 014a4d1..0785825 100644
--- a/gnomeclocks/world.py
+++ b/gnomeclocks/world.py
@@ -20,7 +20,7 @@ import os
 import errno
 import time
 import json
-from gi.repository import GLib, GObject, Gio, Gdk, GdkPixbuf, Gtk
+from gi.repository import GLib, GObject, Gio, GdkPixbuf, Gtk
 from gi.repository import GWeather
 from clocks import Clock
 from utils import Dirs, TimeString, WallClock
@@ -215,7 +215,6 @@ class ClockItem:
         self.is_light = self._get_is_light()
 
 
-
 class ClockStandalone(Gtk.EventBox):
     def __init__(self):
         Gtk.EventBox.__init__(self)
@@ -403,9 +402,7 @@ class World(Clock):
 
     def _add_clock_item(self, clock):
         label = GLib.markup_escape_text(clock.name)
-        view_iter = self.liststore.append([False,
-                                           "<b>%s</b>" % label,
-                                           clock])
+        self.liststore.append([False, "<b>%s</b>" % label, clock])
         self.notify("can-select")
 
     def delete_clocks(self, clocks):



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]