Commit c8bc6ae1 authored by Johan Dahlin's avatar Johan Dahlin Committed by Johan Dahlin
Browse files

Correct pyflakes warnings/errors

And add a target to make check that runs pyflakes.

https://bugzilla.gnome.org/show_bug.cgi?id=672578
parent 39650906
......@@ -65,7 +65,7 @@ class EntryBufferApp:
Gtk.main_quit()
def main(demoapp=None):
app = EntryBufferApp()
EntryBufferApp()
Gtk.main()
if __name__ == '__main__':
......
......@@ -79,7 +79,7 @@ class EntryBufferApp:
Gtk.main_quit()
def main(demoapp=None):
app = EntryBufferApp()
EntryBufferApp()
Gtk.main()
if __name__ == '__main__':
......
......@@ -24,7 +24,7 @@ description = """
GtkEntry allows to display icons and progress information. This demo shows how to use these features in a search entry.
"""
from gi.repository import Gtk, Gdk, GdkPixbuf, GLib, GObject
from gi.repository import Gtk, GObject
(PIXBUF_COL,
TEXT_COL) = range(2)
......@@ -218,10 +218,10 @@ class SearchboxApp:
self.start_search(button, entry)
def search_entry_destroyed(self, widget):
if finish_search_id != 0:
GObject.source_remove(finish_search_id)
if search_progress_id != 0:
GObject.source_remove(search_progress_id)
if self.finish_search_id != 0:
GObject.source_remove(self.finish_search_id)
if self.search_progress_id != 0:
GObject.source_remove(self.search_progress_id)
self.window = None
......@@ -245,7 +245,7 @@ class SearchboxApp:
menu.append (item)
def main(demoapp=None):
app = SearchboxApp(demoapp)
SearchboxApp(demoapp)
Gtk.main()
if __name__ == '__main__':
......
......@@ -213,7 +213,7 @@ class IconViewApp:
store.append((path, name, pixbuf, is_dir))
def main(demoapp=None):
app = IconViewApp(demoapp)
IconViewApp(demoapp)
Gtk.main()
if __name__ == '__main__':
......
......@@ -94,7 +94,7 @@ class IconviewEditApp:
model.set_row(iter_, [text])
def main(demoapp=None):
app = IconviewEditApp()
IconviewEditApp()
Gtk.main()
if __name__ == '__main__':
......
......@@ -25,7 +25,6 @@ The GtkListStore is used to store data in list form, to be used later on by a Gt
"""
from gi.repository import Gtk, GObject
import sys
class Bug:
def __init__(self, is_fixed, number, severity, description):
......@@ -198,7 +197,7 @@ class ListStoreApp:
model.set_value(iter_, self.COLUMN_FIXED, is_fixed)
def main(demoapp=None):
app = ListStoreApp()
ListStoreApp()
Gtk.main()
if __name__ == '__main__':
......
......@@ -24,17 +24,15 @@ description = """
Demonstrates a typical application window with menubar, toolbar, statusbar.
"""
import os
import sys
from gi.repository import GLib, GdkPixbuf, Gdk, Gtk
from gi.repository import GdkPixbuf, Gtk
global infobar
global window
global messagelabel
global _demoapp
infobar = None
window = None
messagelabel = None
_demoapp = None
def widget_destroy(widget, button):
widget.destroy()
......@@ -280,6 +278,7 @@ def register_stock_icons():
Gtk.stock_add(item, 1)
'''
global _demoapp
factory = Gtk.IconFactory()
factory.add_default()
......
......@@ -27,7 +27,7 @@ through these steps.
"""
from gi.repository import Gtk, GdkPixbuf
from gi.repository import Gtk
class AssistantApp:
......@@ -126,7 +126,7 @@ class AssistantApp:
self.assistant.set_page_header_image(label, pixbuf)
def main(demoapp=None):
app = AssistantApp()
AssistantApp()
Gtk.main()
if __name__ == '__main__':
......
......@@ -27,7 +27,7 @@ Demonstrates an interface loaded from a XML description.
import os
from gi.repository import Gtk, GdkPixbuf, Gdk
from gi.repository import Gtk
class BuilderApp:
......@@ -56,7 +56,7 @@ class BuilderApp:
Gtk.main_quit()
def main(demoapp=None):
app = BuilderApp(demoapp)
BuilderApp(demoapp)
Gtk.main()
if __name__ == '__main__':
......
......@@ -113,7 +113,7 @@ class ButtonBoxApp:
return frame
def main(demoapp=None):
app = ButtonBoxApp()
ButtonBoxApp()
Gtk.main()
if __name__ == '__main__':
......
......@@ -224,7 +224,7 @@ class ClipboardApp:
self.menu.popup(None, None, None, None, event.button, event.time)
def main(demoapp=None):
app = ClipboardApp()
ClipboardApp()
Gtk.main()
if __name__ == '__main__':
......
......@@ -103,7 +103,7 @@ class ColorSelectorApp:
dialog.destroy()
def main(demoapp=None):
app = ColorSelectorApp()
ColorSelectorApp()
Gtk.main()
if __name__ == '__main__':
......
......@@ -29,7 +29,7 @@ How the options are displayed is controlled by cell renderers.
"""
from gi.repository import Gtk, Gdk, GdkPixbuf, GLib, GObject
from gi.repository import Gtk, Gdk, GdkPixbuf, GLib
(PIXBUF_COL,
......@@ -331,7 +331,7 @@ class ComboboxApp:
entry.append_text('Three')
def main(demoapp=None):
app = ComboboxApp(demoapp)
ComboboxApp(demoapp)
Gtk.main()
if __name__ == '__main__':
......
......@@ -24,7 +24,7 @@ description = """
Dialog widgets are used to pop up a transient window for user feedback.
"""
from gi.repository import Gtk, GdkPixbuf
from gi.repository import Gtk
class DialogsApp:
def __init__(self):
......@@ -146,7 +146,7 @@ class DialogsApp:
dialog.destroy()
def main(demoapp=None):
app = DialogsApp()
DialogsApp()
Gtk.main()
if __name__ == '__main__':
......
......@@ -198,7 +198,7 @@ class DrawingAreaApp:
return True
def main(demoapp=None):
app = DrawingAreaApp()
DrawingAreaApp()
Gtk.main()
if __name__ == '__main__':
......
......@@ -25,7 +25,7 @@ GtkExpander allows to provide additional content that is initially hidden.
This is also known as "disclosure triangle".
"""
from gi.repository import Gtk, GdkPixbuf
from gi.repository import Gtk
class ExpanderApp:
def __init__(self):
......@@ -53,7 +53,7 @@ class ExpanderApp:
self.window.show_all()
def main(demoapp=None):
app = ExpanderApp()
ExpanderApp()
Gtk.main()
if __name__ == '__main__':
......
......@@ -24,11 +24,11 @@ description = """GtkImage is used to display an image; the image can be in a num
This demo code shows some of the more obscure cases, in the simple case a call to gtk_image_new_from_file() is all you need.
"""
from gi.repository import Gtk, Gdk, GdkPixbuf, GLib, Gio, GObject
import os
import math
from os import path
from gi.repository import Gtk, Gdk, GdkPixbuf, GLib, Gio, GObject
class ImagesApp:
def __init__(self):
self.pixbuf_loader = None
......@@ -63,7 +63,7 @@ class ImagesApp:
filename = os.path.join(self.base_path, 'gtk-logo-rgb.gif')
pixbuf = GdkPixbuf.Pixbuf.new_from_file(filename)
transparent = pixbuf.add_alpha(True, 0xff, 0xff, 0xff)
image = Gtk.Image.new_from_pixbuf(pixbuf)
image = Gtk.Image.new_from_pixbuf(transparent)
frame.add(image)
# Animation
......@@ -293,7 +293,7 @@ class ImagesApp:
Gtk.main_quit()
def main(demoapp=None):
app = ImagesApp()
ImagesApp()
Gtk.main()
if __name__ == '__main__':
......
......@@ -92,7 +92,7 @@ class InfobarApp:
dialog.destroy()
def main(demoapp=None):
app = InfobarApp()
InfobarApp()
Gtk.main()
if __name__ == '__main__':
......
......@@ -67,7 +67,7 @@ a program (exclusively) via keyboard input."""
dialog.destroy()
def main(demoapp=None):
app = LinksApp()
LinksApp()
Gtk.main()
if __name__ == '__main__':
......
......@@ -47,8 +47,6 @@ class MenusApp:
menubar = Gtk.MenuBar()
box1.pack_start(menubar, False, True, 0)
menu = self.create_menu(2, True)
menuitem = Gtk.MenuItem(label='test\nline2')
menuitem.set_submenu(self.create_menu(3, True))
menubar.append(menuitem)
......@@ -78,7 +76,6 @@ class MenusApp:
return None
menu = Gtk.Menu()
group = None
if tearoff:
menuitem = Gtk.TearoffMenuItem()
......@@ -115,7 +112,7 @@ class MenusApp:
menubar.props.pack_direction = Gtk.PackDirection.LTR
def main(demoapp=None):
app = MenusApp()
MenusApp()
Gtk.main()
if __name__ == '__main__':
......
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