PEP8 cleanup: fix number of blank lines
Caught by pep8. Reviewed-by: James Cameron <quozl@laptop.org> Acked-by: Simon Schampijer <simon@laptop.org> CC: Aleksey Lim <alsroot@member.fsf.org>
This commit is contained in:
parent
131c28bb72
commit
e2231d5620
@ -17,6 +17,7 @@ box.pack_start(toolbar, False)
|
|||||||
text_view = gtk.TextView()
|
text_view = gtk.TextView()
|
||||||
box.pack_start(text_view)
|
box.pack_start(text_view)
|
||||||
|
|
||||||
|
|
||||||
def echo(button, label):
|
def echo(button, label):
|
||||||
if not button.props.active:
|
if not button.props.active:
|
||||||
return
|
return
|
||||||
|
@ -25,6 +25,7 @@ toolbar.toolbar.insert(tollbarbutton_2, -1)
|
|||||||
|
|
||||||
toolbar.toolbar.insert(gtk.SeparatorToolItem(), -1)
|
toolbar.toolbar.insert(gtk.SeparatorToolItem(), -1)
|
||||||
|
|
||||||
|
|
||||||
def del_cb(widget):
|
def del_cb(widget):
|
||||||
toolbar.toolbar.remove(tollbarbutton_3)
|
toolbar.toolbar.remove(tollbarbutton_3)
|
||||||
del_b = gtk.Button('delete sub-widget #3')
|
del_b = gtk.Button('delete sub-widget #3')
|
||||||
|
@ -98,6 +98,7 @@ J_DBUS_INTERFACE = 'org.laptop.Journal'
|
|||||||
|
|
||||||
CONN_INTERFACE_ACTIVITY_PROPERTIES = 'org.laptop.Telepathy.ActivityProperties'
|
CONN_INTERFACE_ACTIVITY_PROPERTIES = 'org.laptop.Telepathy.ActivityProperties'
|
||||||
|
|
||||||
|
|
||||||
class _ActivitySession(gobject.GObject):
|
class _ActivitySession(gobject.GObject):
|
||||||
|
|
||||||
__gsignals__ = {
|
__gsignals__ = {
|
||||||
|
@ -291,6 +291,7 @@ class ConfirmationAlert(Alert):
|
|||||||
self.add_button(gtk.RESPONSE_OK, _('Ok'), icon)
|
self.add_button(gtk.RESPONSE_OK, _('Ok'), icon)
|
||||||
icon.show()
|
icon.show()
|
||||||
|
|
||||||
|
|
||||||
class ErrorAlert(Alert):
|
class ErrorAlert(Alert):
|
||||||
"""
|
"""
|
||||||
This is a ready-made one button (Ok) alert.
|
This is a ready-made one button (Ok) alert.
|
||||||
@ -336,6 +337,7 @@ class ErrorAlert(Alert):
|
|||||||
self.add_button(gtk.RESPONSE_OK, _('Ok'), icon)
|
self.add_button(gtk.RESPONSE_OK, _('Ok'), icon)
|
||||||
icon.show()
|
icon.show()
|
||||||
|
|
||||||
|
|
||||||
class _TimeoutIcon(hippo.CanvasText, hippo.CanvasItem):
|
class _TimeoutIcon(hippo.CanvasText, hippo.CanvasItem):
|
||||||
"""An icon with a round border"""
|
"""An icon with a round border"""
|
||||||
__gtype_name__ = 'AlertTimeoutIcon'
|
__gtype_name__ = 'AlertTimeoutIcon'
|
||||||
|
@ -669,6 +669,7 @@ class Invoker(gobject.GObject):
|
|||||||
if not self.props.cache_palette:
|
if not self.props.cache_palette:
|
||||||
self.set_palette(None)
|
self.set_palette(None)
|
||||||
|
|
||||||
|
|
||||||
class WidgetInvoker(Invoker):
|
class WidgetInvoker(Invoker):
|
||||||
|
|
||||||
def __init__(self, parent=None, widget=None):
|
def __init__(self, parent=None, widget=None):
|
||||||
|
@ -463,11 +463,13 @@ class Activity(gobject.GObject):
|
|||||||
_logger.debug('%r: leaving', self)
|
_logger.debug('%r: leaving', self)
|
||||||
self.telepathy_text_chan.Close()
|
self.telepathy_text_chan.Close()
|
||||||
|
|
||||||
|
|
||||||
class _BaseCommand(gobject.GObject):
|
class _BaseCommand(gobject.GObject):
|
||||||
__gsignals__ = {
|
__gsignals__ = {
|
||||||
'finished': (gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE,
|
'finished': (gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE,
|
||||||
([object])),
|
([object])),
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
gobject.GObject.__init__(self)
|
gobject.GObject.__init__(self)
|
||||||
|
|
||||||
@ -532,6 +534,7 @@ class _ShareCommand(_BaseCommand):
|
|||||||
self._finished = True
|
self._finished = True
|
||||||
self.emit('finished', error)
|
self.emit('finished', error)
|
||||||
|
|
||||||
|
|
||||||
class _JoinCommand(_BaseCommand):
|
class _JoinCommand(_BaseCommand):
|
||||||
def __init__(self, connection, room_handle):
|
def __init__(self, connection, room_handle):
|
||||||
_BaseCommand.__init__(self)
|
_BaseCommand.__init__(self)
|
||||||
|
@ -144,6 +144,7 @@ class BaseBuddy(gobject.GObject):
|
|||||||
|
|
||||||
class Buddy(BaseBuddy):
|
class Buddy(BaseBuddy):
|
||||||
__gtype_name__ = 'PresenceBuddy'
|
__gtype_name__ = 'PresenceBuddy'
|
||||||
|
|
||||||
def __init__(self, account_path, contact_id):
|
def __init__(self, account_path, contact_id):
|
||||||
_logger.debug('Buddy.__init__')
|
_logger.debug('Buddy.__init__')
|
||||||
BaseBuddy.__init__(self)
|
BaseBuddy.__init__(self)
|
||||||
|
@ -31,12 +31,14 @@ from telepathy.constants import CONNECTION_STATUS_CONNECTED
|
|||||||
ACCOUNT_MANAGER_SERVICE = 'org.freedesktop.Telepathy.AccountManager'
|
ACCOUNT_MANAGER_SERVICE = 'org.freedesktop.Telepathy.AccountManager'
|
||||||
ACCOUNT_MANAGER_PATH = '/org/freedesktop/Telepathy/AccountManager'
|
ACCOUNT_MANAGER_PATH = '/org/freedesktop/Telepathy/AccountManager'
|
||||||
|
|
||||||
|
|
||||||
class Connection(object):
|
class Connection(object):
|
||||||
def __init__(self, account_path, connection):
|
def __init__(self, account_path, connection):
|
||||||
self.account_path = account_path
|
self.account_path = account_path
|
||||||
self.connection = connection
|
self.connection = connection
|
||||||
self.connected = False
|
self.connected = False
|
||||||
|
|
||||||
|
|
||||||
class ConnectionManager(object):
|
class ConnectionManager(object):
|
||||||
"""Track available telepathy connections"""
|
"""Track available telepathy connections"""
|
||||||
|
|
||||||
@ -108,8 +110,8 @@ class ConnectionManager(object):
|
|||||||
return account_path
|
return account_path
|
||||||
return None
|
return None
|
||||||
|
|
||||||
_connection_manager = None
|
|
||||||
|
|
||||||
|
_connection_manager = None
|
||||||
def get_connection_manager():
|
def get_connection_manager():
|
||||||
global _connection_manager
|
global _connection_manager
|
||||||
if not _connection_manager:
|
if not _connection_manager:
|
||||||
|
@ -37,6 +37,7 @@ from telepathy.interfaces import ACCOUNT, \
|
|||||||
CONNECTION
|
CONNECTION
|
||||||
from telepathy.constants import HANDLE_TYPE_CONTACT
|
from telepathy.constants import HANDLE_TYPE_CONTACT
|
||||||
|
|
||||||
|
|
||||||
_logger = logging.getLogger('sugar.presence.presenceservice')
|
_logger = logging.getLogger('sugar.presence.presenceservice')
|
||||||
|
|
||||||
ACCOUNT_MANAGER_SERVICE = 'org.freedesktop.Telepathy.AccountManager'
|
ACCOUNT_MANAGER_SERVICE = 'org.freedesktop.Telepathy.AccountManager'
|
||||||
@ -44,6 +45,7 @@ ACCOUNT_MANAGER_PATH = '/org/freedesktop/Telepathy/AccountManager'
|
|||||||
|
|
||||||
CONN_INTERFACE_ACTIVITY_PROPERTIES = 'org.laptop.Telepathy.ActivityProperties'
|
CONN_INTERFACE_ACTIVITY_PROPERTIES = 'org.laptop.Telepathy.ActivityProperties'
|
||||||
|
|
||||||
|
|
||||||
class PresenceService(gobject.GObject):
|
class PresenceService(gobject.GObject):
|
||||||
"""Provides simplified access to the Telepathy framework to activities"""
|
"""Provides simplified access to the Telepathy framework to activities"""
|
||||||
__gsignals__ = {
|
__gsignals__ = {
|
||||||
|
@ -22,6 +22,7 @@ UNSTABLE. Used only internally by Activity and jarabe.
|
|||||||
import gtk
|
import gtk
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
|
||||||
def _property_get_trapped(window, prop, prop_type):
|
def _property_get_trapped(window, prop, prop_type):
|
||||||
gtk.gdk.error_trap_push()
|
gtk.gdk.error_trap_push()
|
||||||
|
|
||||||
@ -35,6 +36,7 @@ def _property_get_trapped(window, prop, prop_type):
|
|||||||
|
|
||||||
return prop_info
|
return prop_info
|
||||||
|
|
||||||
|
|
||||||
def _property_change_trapped(window, prop, prop_type, format, mode, data):
|
def _property_change_trapped(window, prop, prop_type, format, mode, data):
|
||||||
gtk.gdk.error_trap_push()
|
gtk.gdk.error_trap_push()
|
||||||
|
|
||||||
@ -83,4 +85,3 @@ def set_activity_id(window, activity_id):
|
|||||||
def set_bundle_id(window, bundle_id):
|
def set_bundle_id(window, bundle_id):
|
||||||
_property_change_trapped(window, '_SUGAR_BUNDLE_ID', 'STRING', 8,
|
_property_change_trapped(window, '_SUGAR_BUNDLE_ID', 'STRING', 8,
|
||||||
gtk.gdk.PROP_MODE_REPLACE, bundle_id)
|
gtk.gdk.PROP_MODE_REPLACE, bundle_id)
|
||||||
|
|
||||||
|
@ -19,10 +19,12 @@ import gtk
|
|||||||
|
|
||||||
from sugar.graphics.toolbutton import ToolButton
|
from sugar.graphics.toolbutton import ToolButton
|
||||||
|
|
||||||
|
|
||||||
class Test(gtk.VBox):
|
class Test(gtk.VBox):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
gtk.VBox.__init__(self)
|
gtk.VBox.__init__(self)
|
||||||
|
|
||||||
|
|
||||||
class TestPalette(Test):
|
class TestPalette(Test):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
Test.__init__(self)
|
Test.__init__(self)
|
||||||
@ -39,6 +41,7 @@ class TestPalette(Test):
|
|||||||
def set_palette(self, palette):
|
def set_palette(self, palette):
|
||||||
self._invoker.set_palette(palette)
|
self._invoker.set_palette(palette)
|
||||||
|
|
||||||
|
|
||||||
class TestRunner(object):
|
class TestRunner(object):
|
||||||
def run(self, test):
|
def run(self, test):
|
||||||
window = gtk.Window()
|
window = gtk.Window()
|
||||||
@ -48,6 +51,7 @@ class TestRunner(object):
|
|||||||
|
|
||||||
window.show()
|
window.show()
|
||||||
|
|
||||||
|
|
||||||
def main(test):
|
def main(test):
|
||||||
runner = TestRunner()
|
runner = TestRunner()
|
||||||
runner.run(test)
|
runner.run(test)
|
||||||
|
@ -19,6 +19,7 @@ canvas.set_root(scrollbars)
|
|||||||
box = hippo.CanvasBox(padding=10, spacing=10)
|
box = hippo.CanvasBox(padding=10, spacing=10)
|
||||||
scrollbars.set_root(box)
|
scrollbars.set_root(box)
|
||||||
|
|
||||||
|
|
||||||
def idle_cb():
|
def idle_cb():
|
||||||
global countdown
|
global countdown
|
||||||
|
|
||||||
|
@ -41,6 +41,7 @@ data = [
|
|||||||
['battery-090', '#D1A3FF,#00A0FF'],
|
['battery-090', '#D1A3FF,#00A0FF'],
|
||||||
['battery-100', '#AC32FF,#FF2B34']]
|
['battery-100', '#AC32FF,#FF2B34']]
|
||||||
|
|
||||||
|
|
||||||
def _button_activated_cb(button):
|
def _button_activated_cb(button):
|
||||||
import random
|
import random
|
||||||
|
|
||||||
|
@ -22,6 +22,7 @@ import unittest
|
|||||||
|
|
||||||
from sugar import mime
|
from sugar import mime
|
||||||
|
|
||||||
|
|
||||||
class TestMime(unittest.TestCase):
|
class TestMime(unittest.TestCase):
|
||||||
def test_from_file_name(self):
|
def test_from_file_name(self):
|
||||||
self.assertEqual(mime.get_from_file_name('test.pdf'),
|
self.assertEqual(mime.get_from_file_name('test.pdf'),
|
||||||
@ -76,6 +77,6 @@ class TestMime(unittest.TestCase):
|
|||||||
'text/plain'])
|
'text/plain'])
|
||||||
self.assertEqual(mime_type, 'text/plain')
|
self.assertEqual(mime_type, 'text/plain')
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user