Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Schampijer <simon@schampijer.de>2013-05-06 13:47:51 (GMT)
committer Simon Schampijer <simon@schampijer.de>2013-05-06 13:47:51 (GMT)
commitc3c0639419e6c630e3f4a3bf633aa5b34648df7c (patch)
tree16dbfd7f1c9d1a6e9be4782a26e6959c31f18035
parent6c4a9b34a115b03b3eb84f89bc4c54263798db65 (diff)
parentfab8f9608856663c386449fcf7cb83277b42d27e (diff)
Merge pull request #18 from dnarvaez/pyflakes
Make the code pyflakes clean
-rw-r--r--Makefile.am1
-rw-r--r--src/sugar3/activity/htmlactivity.py1
-rw-r--r--src/sugar3/dispatch/__init__.py1
-rw-r--r--src/sugar3/dispatch/saferef.py2
-rw-r--r--src/sugar3/graphics/colorbutton.py1
-rw-r--r--src/sugar3/graphics/palette.py7
-rw-r--r--src/sugar3/graphics/radiotoolbutton.py1
-rw-r--r--src/sugar3/graphics/toggletoolbutton.py1
-rw-r--r--src/sugar3/graphics/toolbutton.py1
-rw-r--r--tests/test_uitree.py1
10 files changed, 9 insertions, 8 deletions
diff --git a/Makefile.am b/Makefile.am
index 2240471..fe037da 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -17,6 +17,7 @@ EXTRA_DIST = \
SUBDIRS = bin src po
check: test
+ pyflakes $(top_srcdir)
test:
cd $(top_srcdir)/tests && \
diff --git a/src/sugar3/activity/htmlactivity.py b/src/sugar3/activity/htmlactivity.py
index ac6acc7..38beed5 100644
--- a/src/sugar3/activity/htmlactivity.py
+++ b/src/sugar3/activity/htmlactivity.py
@@ -18,7 +18,6 @@
import json
import os
-from gi.repository import Gtk
from gi.repository import GConf
from gi.repository import WebKit2
from gwebsockets.server import Server
diff --git a/src/sugar3/dispatch/__init__.py b/src/sugar3/dispatch/__init__.py
index 4b0f57d..3a26a6b 100644
--- a/src/sugar3/dispatch/__init__.py
+++ b/src/sugar3/dispatch/__init__.py
@@ -7,3 +7,4 @@ Heavily modified for Django's purposes.
"""
from sugar3.dispatch.dispatcher import Signal
+assert Signal
diff --git a/src/sugar3/dispatch/saferef.py b/src/sugar3/dispatch/saferef.py
index 8bcfd8a..3be5a3f 100644
--- a/src/sugar3/dispatch/saferef.py
+++ b/src/sugar3/dispatch/saferef.py
@@ -121,7 +121,7 @@ class BoundMethodWeakref(object):
except Exception, e:
try:
traceback.print_exc()
- except AttributeError, err:
+ except AttributeError:
print '''Exception during saferef %s cleanup function %s: %s'''%(
self, function, e
)
diff --git a/src/sugar3/graphics/colorbutton.py b/src/sugar3/graphics/colorbutton.py
index 1d2faf8..409e985 100644
--- a/src/sugar3/graphics/colorbutton.py
+++ b/src/sugar3/graphics/colorbutton.py
@@ -545,7 +545,6 @@ class ColorToolButton(Gtk.ToolItem):
title = GObject.property(type=str, getter=get_title, setter=set_title)
def do_draw(self, cr):
- child = self.get_child()
if self._palette and self._palette.is_up():
allocation = self.get_allocation()
# draw a black background, has been done by the engine before
diff --git a/src/sugar3/graphics/palette.py b/src/sugar3/graphics/palette.py
index c6c00bc..a8b10f8 100644
--- a/src/sugar3/graphics/palette.py
+++ b/src/sugar3/graphics/palette.py
@@ -38,7 +38,12 @@ from sugar3.graphics.palettemenu import PaletteMenuItem
# Import these for backwards compatibility
from sugar3.graphics.palettewindow import MouseSpeedDetector, Invoker, \
WidgetInvoker, CursorInvoker, ToolInvoker, CellRendererInvoker
-
+assert MouseSpeedDetector
+assert Invoker
+assert WidgetInvoker
+assert CursorInvoker
+assert ToolInvoker
+assert CellRendererInvoker
class _HeaderItem(Gtk.MenuItem):
"""A MenuItem with a custom child widget that gets all the
diff --git a/src/sugar3/graphics/radiotoolbutton.py b/src/sugar3/graphics/radiotoolbutton.py
index a51a39a..09b26ad 100644
--- a/src/sugar3/graphics/radiotoolbutton.py
+++ b/src/sugar3/graphics/radiotoolbutton.py
@@ -131,7 +131,6 @@ class RadioToolButton(Gtk.RadioToolButton):
type=object, setter=set_palette_invoker, getter=get_palette_invoker)
def do_draw(self, cr):
- child = self.get_child()
if self.palette and self.palette.is_up():
allocation = self.get_allocation()
# draw a black background, has been done by the engine before
diff --git a/src/sugar3/graphics/toggletoolbutton.py b/src/sugar3/graphics/toggletoolbutton.py
index 0c4e592..6d3c7bd 100644
--- a/src/sugar3/graphics/toggletoolbutton.py
+++ b/src/sugar3/graphics/toggletoolbutton.py
@@ -125,7 +125,6 @@ class ToggleToolButton(Gtk.ToggleToolButton):
getter=get_accelerator)
def do_draw(self, cr):
- child = self.get_child()
if self.palette and self.palette.is_up():
allocation = self.get_allocation()
# draw a black background, has been done by the engine before
diff --git a/src/sugar3/graphics/toolbutton.py b/src/sugar3/graphics/toolbutton.py
index 522d653..4a9feee 100644
--- a/src/sugar3/graphics/toolbutton.py
+++ b/src/sugar3/graphics/toolbutton.py
@@ -163,7 +163,6 @@ class ToolButton(Gtk.ToolButton):
type=object, setter=set_palette_invoker, getter=get_palette_invoker)
def do_draw(self, cr):
- child = self.get_child()
if self.palette and self.palette.is_up():
allocation = self.get_allocation()
# draw a black background, has been done by the engine before
diff --git a/tests/test_uitree.py b/tests/test_uitree.py
index d640e10..1104a43 100644
--- a/tests/test_uitree.py
+++ b/tests/test_uitree.py
@@ -35,7 +35,6 @@ class TestUITree(unittest.TestCase):
def show_window1():
from gi.repository import Gtk
- from gi.repository import GLib
window = Gtk.Window()
window.set_title("window1")