Commit 8e75a47c authored by Paolo Borelli's avatar Paolo Borelli

Fix pep8/pyflakes warnings

parent de9070d6
......@@ -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"""
......@@ -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):
......
......@@ -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:
......
......@@ -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)
......
......@@ -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)
......
......@@ -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)
......
......@@ -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()
......
......@@ -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):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment