diff options
author | Daniel Francis <francis@sugarlabs.org> | 2012-10-17 23:28:00 (GMT) |
---|---|---|
committer | Daniel Francis <francis@sugarlabs.org> | 2012-10-17 23:28:00 (GMT) |
commit | 30475ce4c57e24770cc62ed8c9d067d0cd76ef1d (patch) | |
tree | 9e83bb4397b47010122abe6f8c3e78e27bb5aba0 | |
parent | 3c00452b30c713f78e3c0279c4fbf9006e573f7c (diff) |
Pep8 fixes
-rwxr-xr-x | application.py | 10 | ||||
-rw-r--r-- | options.py | 24 | ||||
-rw-r--r-- | sugar/sweetener/alerts.py | 2 |
3 files changed, 23 insertions, 13 deletions
diff --git a/application.py b/application.py index 89961c9..7fcac0c 100755 --- a/application.py +++ b/application.py @@ -140,7 +140,7 @@ class Application(gtk.Window): def expose_event(self, widget, event): #logger.debug('Exposing') if not self.started: - if self.file_path != None: + if self.file_path is not None: self.canvas.read_file(self.file_path) self.set_title(os.path.abspath('%s - %s' % (self.file_path, appname))) @@ -202,7 +202,8 @@ class Application(gtk.Window): def stop(self): if info.io_mode == info.CONFIG: - self.file_path = os.path.join(os.environ['HOME'], '.' + info.lower_name) + self.file_path = os.path.join(os.environ['HOME'], + '.' + info.lower_name) self.save() gtk.main_quit() @@ -221,7 +222,7 @@ class Application(gtk.Window): self.set_title('%s - %s' % (self.file_path, appname)) def save(self): - if self.file_path == None: + if self.file_path is None: self.save_as() else: logger.debug('Write file %s' % self.file_path) @@ -259,7 +260,8 @@ if __name__ == '__main__': file_path = None logger.debug('Create new file') else: - if os.path.exists(os.path.join(os.environ['HOME'], '.' + info.lower_name)): + if os.path.exists(os.path.join(os.environ['HOME'], + '.' + info.lower_name)): file_path = os.path.join(os.environ['HOME'], '.' + info.lower_name) else: file_path = None @@ -39,7 +39,8 @@ class Options(ItemBox): self.basic = BasicOptions(activity, self, None) self.canvas_ghost = GhostGroup(self, _('_Canvas')) - stock.register('illustrate-alerts', _('Alerts'), '<Ctrl>T', 'alert-icon') + stock.register('illustrate-alerts', _('Alerts'), '<Ctrl>T', + 'alert-icon') self.alerts = SettingsItem(self.activity, 'illustrate-alerts', True) if os.environ['PROGRAMRUNNING'] == 'SUGAR': content = gtk.HBox() @@ -60,16 +61,21 @@ class Options(ItemBox): self.alerts.content = content self.canvas_ghost.append_item(self.alerts) self.canvas_ghost.append_separator(True) - stock.register('illustrate-circle', _('_Circle'), '<Ctrl>I', 'sugar-integration') - self.circle_item = RadioItem(None, stock_id='illustrate-circle', important=True) + stock.register('illustrate-circle', _('_Circle'), '<Ctrl>I', + 'sugar-integration') + self.circle_item = RadioItem(None, stock_id='illustrate-circle', + important=True) self.canvas_ghost.append_item(self.circle_item) stock.register('illustrate-spiral', _('_Spiral'), '<Ctrl>P', 'spiral') - self.spiral_item = RadioItem(self.circle_item, False, 'illustrate-spiral', True) + self.spiral_item = RadioItem(self.circle_item, False, + 'illustrate-spiral', True) self.canvas_ghost.append_item(self.spiral_item) stock.register('illustrate-square', _('S_quare'), '<Ctrl>E', 'square') - self.square_item = RadioItem(self.circle_item, False, 'illustrate-square', True) + self.square_item = RadioItem(self.circle_item, False, + 'illustrate-square', True) self.canvas_ghost.append_item(self.square_item) - self.settings_group = ItemGroup(self, _('_Settings'), 'preferences-system') + self.settings_group = ItemGroup(self, _('_Settings'), + 'preferences-system') self.fill = ColorItem(activity) stock.register('illustrate-fill', _('_Fill'), '<Ctrl>F', gtk.STOCK_SELECT_COLOR) @@ -85,9 +91,11 @@ class Options(ItemBox): self.toolbar.show() def simple_alert(self, widget): - alert = Alert(self.activity, _('Simple Alert'), _('Message'), gtk.MESSAGE_INFO) + alert = Alert(self.activity, _('Simple Alert'), _('Message'), + gtk.MESSAGE_INFO) self.activity.add_alert(alert) def notify_alert(self, widget): - alert = NotifyAlert(self.activity, _('Notify Alert'), _('Message'), None, 10) + alert = NotifyAlert(self.activity, _('Notify Alert'), + _('Message'), None, 10) self.activity.add_alert(alert) diff --git a/sugar/sweetener/alerts.py b/sugar/sweetener/alerts.py index 86d3351..9609a82 100644 --- a/sugar/sweetener/alerts.py +++ b/sugar/sweetener/alerts.py @@ -50,7 +50,7 @@ class NotifyAlert(SugarNotify): self._parent = parent self.props.title = title self.props.msg = content - if icon != None: + if icon is not None: icon = Icon(icon_name=icon) icon.show() self.props.icon = icon |