Skip to content

Commit

Permalink
style cleanup: use """ everywhere
Browse files Browse the repository at this point in the history
Most of the code uses """, so adjust the few deviations.

Reviewed-by: James Cameron <[email protected]>
CC: Aleksey Lim <[email protected]>
  • Loading branch information
silbe committed Nov 24, 2010
1 parent c442960 commit 90a84c3
Show file tree
Hide file tree
Showing 13 changed files with 30 additions and 33 deletions.
4 changes: 2 additions & 2 deletions docs/release_howto.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
''' This is the release process of the sugar tarballs sugar(shell),
""" This is the release process of the sugar tarballs sugar(shell),
sugar-toolkit and sugar-base described in a pytish way and
instructions for sugar packagers
'''
"""

# Release sugar tarballs

Expand Down
2 changes: 1 addition & 1 deletion extensions/cpsection/datetime/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@


def _initialize():
'''Initialize the docstring of the set function'''
"""Initialize the docstring of the set function"""
if set_timezone.__doc__ is None:
# when running under 'python -OO', all __doc__ fields are None,
# so += would fail -- and this function would be unnecessary anyway.
Expand Down
2 changes: 1 addition & 1 deletion extensions/cpsection/keyboard/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ def __determine_add_remove_box_visibility(self):
i += 1

def __create_add_remove_box(self):
'''Creates gtk.Hbox with add/remove buttons'''
"""Creates gtk.Hbox with add/remove buttons"""
add_icon = Icon(icon_name='list-add')

add_button = gtk.Button()
Expand Down
6 changes: 3 additions & 3 deletions extensions/cpsection/language/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def __init__(self, model, alerts):
self.setup()

def _add_row(self, locale_code=None):
'''Adds a row to the table'''
"""Adds a row to the table"""

self._selected_lang_count += 1

Expand Down Expand Up @@ -149,7 +149,7 @@ def _attach_to_table(self, widget, row, column, padding=20, \
ypadding=padding)

def _delete_last_row(self):
'''Deletes the last row of the table'''
"""Deletes the last row of the table"""

self._selected_lang_count -= 1

Expand Down Expand Up @@ -180,7 +180,7 @@ def undo(self):
self._lang_alert.hide()

def _create_add_remove_box(self):
'''Creates gtk.Hbox with add/remove buttons'''
"""Creates gtk.Hbox with add/remove buttons"""
add_icon = Icon(icon_name='list-add')

add_button = gtk.Button()
Expand Down
8 changes: 4 additions & 4 deletions extensions/cpsection/updater/backends/aslo.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

'''Activity information microformat parser.
"""Activity information microformat parser.
Activity information is embedded in HTML/XHTML/XML pages using a
Resource Description Framework (RDF) http://www.w3.org/RDF/ .
Expand Down Expand Up @@ -46,7 +46,7 @@
</RDF:Description>
</em:targetApplication>
</RDF:Description></RDF:RDF>
'''
"""

import logging
from xml.etree.ElementTree import XML
Expand Down Expand Up @@ -149,13 +149,13 @@ def _process_result(self):


def fetch_update_info(bundle, completion_cb):
'''Queries the server for a newer version of the ActivityBundle.
"""Queries the server for a newer version of the ActivityBundle.
completion_cb receives bundle, version, link, size and possibly an error
message:
def completion_cb(bundle, version, link, size, error_message):
'''
"""
global _fetcher

if _fetcher is not None:
Expand Down
4 changes: 2 additions & 2 deletions extensions/cpsection/updater/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
'''Sugar bundle updater: model.
"""Sugar bundle updater: model.
This module implements the non-GUI portions of the bundle updater, including
list of installed bundls, whether updates are needed, and the URL at which to
find the bundle updated.
'''
"""

import os
import logging
Expand Down
8 changes: 3 additions & 5 deletions extensions/cpsection/updater/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,8 @@ def undo(self):


class ProgressPane(gtk.VBox):
'''Container which replaces the `ActivityPane` during refresh or
install.'''
"""Container which replaces the `ActivityPane` during refresh or
install."""

def __init__(self):
gtk.VBox.__init__(self)
Expand Down Expand Up @@ -376,9 +376,7 @@ def __init__(self, model):


def _format_size(size):
'''
Convert a given size in bytes to a nicer better readable unit
'''
"""Convert a given size in bytes to a nicer better readable unit"""
if size == 0:
# TRANS: download size is 0
return _('None')
Expand Down
8 changes: 4 additions & 4 deletions src/jarabe/controlpanel/cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@


def cmd_help():
'''Print the help to the screen'''
"""Print the help to the screen"""
# TRANS: Translators, there's a empty line at the end of this string,
# which must appear in the translated string (msgstr) as well.
print _('Usage: sugar-control-panel [ option ] key [ args ... ] \n\
Expand All @@ -49,14 +49,14 @@ def cmd_help():


def note_restart():
'''Instructions how to restart sugar'''
"""Instructions how to restart sugar"""
print _('To apply your changes you have to restart sugar.\n' +
'Hit ctrl+alt+erase on the keyboard to trigger a restart.')


def load_modules():
'''Build a list of pointers to available modules and import them.
'''
"""Build a list of pointers to available modules and import them.
"""
modules = []

path = os.path.join(config.ext_path, 'cpsection')
Expand Down
8 changes: 4 additions & 4 deletions src/jarabe/controlpanel/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,13 +229,13 @@ def show_section_view(self, option):
style.COLOR_WHITE.get_gdk_color())

def set_section_view_auto_close(self):
'''Automatically close the control panel if there is "nothing to do"
'''
"""Automatically close the control panel if there is "nothing to do"
"""
self._section_view.auto_close = True

def _get_options(self):
'''Get the available option information from the extensions
'''
"""Get the available option information from the extensions
"""
options = {}

path = os.path.join(config.ext_path, 'cpsection')
Expand Down
2 changes: 1 addition & 1 deletion src/jarabe/controlpanel/sectionview.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,5 @@ def do_get_property(self, pspec):
return self._is_valid

def undo(self):
'''Undo here the changes that have been made in this section.'''
"""Undo here the changes that have been made in this section."""
pass
4 changes: 2 additions & 2 deletions src/jarabe/journal/journalactivity.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,11 +334,11 @@ def __visibility_notify_event_cb(self, window, event):
self._list_view.set_is_visible(visible)

def _check_available_space(self):
''' Check available space on device
"""Check available space on device
If the available space is below 50MB an alert will be
shown which encourages to delete old journal entries.
'''
"""

if self._critical_space_alert:
return
Expand Down
3 changes: 1 addition & 2 deletions src/jarabe/journal/modalalert.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,5 @@ def __realize_cb(self, widget):
self.window.set_accept_focus(True)

def __show_journal_cb(self, button):
'''The opener will listen on the destroy signal
'''
"""The opener will listen on the destroy signal"""
self.destroy()
4 changes: 2 additions & 2 deletions src/jarabe/model/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -523,9 +523,9 @@ def __secrets_request_cb(self, sender, **kwargs):


class SecretsResponse(object):
''' Intermediate object to report the secrets from the dialog
"""Intermediate object to report the secrets from the dialog
back to the connection object and which will inform NM
'''
"""
def __init__(self, connection, reply_cb, error_cb):
self._connection = connection
self._reply_cb = reply_cb
Expand Down

0 comments on commit 90a84c3

Please sign in to comment.