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:
Sascha Silbe 2010-10-15 17:53:25 +00:00
parent 131c28bb72
commit e2231d5620
14 changed files with 25 additions and 3 deletions

View File

@ -17,6 +17,7 @@ box.pack_start(toolbar, False)
text_view = gtk.TextView()
box.pack_start(text_view)
def echo(button, label):
if not button.props.active:
return

View File

@ -25,6 +25,7 @@ toolbar.toolbar.insert(tollbarbutton_2, -1)
toolbar.toolbar.insert(gtk.SeparatorToolItem(), -1)
def del_cb(widget):
toolbar.toolbar.remove(tollbarbutton_3)
del_b = gtk.Button('delete sub-widget #3')

View File

@ -98,6 +98,7 @@ J_DBUS_INTERFACE = 'org.laptop.Journal'
CONN_INTERFACE_ACTIVITY_PROPERTIES = 'org.laptop.Telepathy.ActivityProperties'
class _ActivitySession(gobject.GObject):
__gsignals__ = {

View File

@ -291,6 +291,7 @@ class ConfirmationAlert(Alert):
self.add_button(gtk.RESPONSE_OK, _('Ok'), icon)
icon.show()
class ErrorAlert(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)
icon.show()
class _TimeoutIcon(hippo.CanvasText, hippo.CanvasItem):
"""An icon with a round border"""
__gtype_name__ = 'AlertTimeoutIcon'

View File

@ -669,6 +669,7 @@ class Invoker(gobject.GObject):
if not self.props.cache_palette:
self.set_palette(None)
class WidgetInvoker(Invoker):
def __init__(self, parent=None, widget=None):

View File

@ -463,11 +463,13 @@ class Activity(gobject.GObject):
_logger.debug('%r: leaving', self)
self.telepathy_text_chan.Close()
class _BaseCommand(gobject.GObject):
__gsignals__ = {
'finished': (gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE,
([object])),
}
def __init__(self):
gobject.GObject.__init__(self)
@ -532,6 +534,7 @@ class _ShareCommand(_BaseCommand):
self._finished = True
self.emit('finished', error)
class _JoinCommand(_BaseCommand):
def __init__(self, connection, room_handle):
_BaseCommand.__init__(self)

View File

@ -144,6 +144,7 @@ class BaseBuddy(gobject.GObject):
class Buddy(BaseBuddy):
__gtype_name__ = 'PresenceBuddy'
def __init__(self, account_path, contact_id):
_logger.debug('Buddy.__init__')
BaseBuddy.__init__(self)

View File

@ -31,12 +31,14 @@ from telepathy.constants import CONNECTION_STATUS_CONNECTED
ACCOUNT_MANAGER_SERVICE = 'org.freedesktop.Telepathy.AccountManager'
ACCOUNT_MANAGER_PATH = '/org/freedesktop/Telepathy/AccountManager'
class Connection(object):
def __init__(self, account_path, connection):
self.account_path = account_path
self.connection = connection
self.connected = False
class ConnectionManager(object):
"""Track available telepathy connections"""
@ -108,8 +110,8 @@ class ConnectionManager(object):
return account_path
return None
_connection_manager = None
_connection_manager = None
def get_connection_manager():
global _connection_manager
if not _connection_manager:

View File

@ -37,6 +37,7 @@ from telepathy.interfaces import ACCOUNT, \
CONNECTION
from telepathy.constants import HANDLE_TYPE_CONTACT
_logger = logging.getLogger('sugar.presence.presenceservice')
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'
class PresenceService(gobject.GObject):
"""Provides simplified access to the Telepathy framework to activities"""
__gsignals__ = {

View File

@ -22,6 +22,7 @@ UNSTABLE. Used only internally by Activity and jarabe.
import gtk
import logging
def _property_get_trapped(window, prop, prop_type):
gtk.gdk.error_trap_push()
@ -35,6 +36,7 @@ def _property_get_trapped(window, prop, prop_type):
return prop_info
def _property_change_trapped(window, prop, prop_type, format, mode, data):
gtk.gdk.error_trap_push()
@ -83,4 +85,3 @@ def set_activity_id(window, activity_id):
def set_bundle_id(window, bundle_id):
_property_change_trapped(window, '_SUGAR_BUNDLE_ID', 'STRING', 8,
gtk.gdk.PROP_MODE_REPLACE, bundle_id)

View File

@ -19,10 +19,12 @@ import gtk
from sugar.graphics.toolbutton import ToolButton
class Test(gtk.VBox):
def __init__(self):
gtk.VBox.__init__(self)
class TestPalette(Test):
def __init__(self):
Test.__init__(self)
@ -39,6 +41,7 @@ class TestPalette(Test):
def set_palette(self, palette):
self._invoker.set_palette(palette)
class TestRunner(object):
def run(self, test):
window = gtk.Window()
@ -48,6 +51,7 @@ class TestRunner(object):
window.show()
def main(test):
runner = TestRunner()
runner.run(test)

View File

@ -19,6 +19,7 @@ canvas.set_root(scrollbars)
box = hippo.CanvasBox(padding=10, spacing=10)
scrollbars.set_root(box)
def idle_cb():
global countdown

View File

@ -41,6 +41,7 @@ data = [
['battery-090', '#D1A3FF,#00A0FF'],
['battery-100', '#AC32FF,#FF2B34']]
def _button_activated_cb(button):
import random

View File

@ -22,6 +22,7 @@ import unittest
from sugar import mime
class TestMime(unittest.TestCase):
def test_from_file_name(self):
self.assertEqual(mime.get_from_file_name('test.pdf'),
@ -76,6 +77,6 @@ class TestMime(unittest.TestCase):
'text/plain'])
self.assertEqual(mime_type, 'text/plain')
if __name__ == "__main__":
unittest.main()