Skip to content

Commit

Permalink
Docstrings should use triple double quotes (PEP257)
Browse files Browse the repository at this point in the history
https://www.python.org/dev/peps/pep-0257/#id15

For consistency, always use """triple double quotes""" around docstrings.
  • Loading branch information
zas committed Dec 16, 2018
1 parent a4b2488 commit b7203e4
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 15 deletions.
8 changes: 4 additions & 4 deletions picard/coverart/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,20 +209,20 @@ def next_in_queue(self):
self.album._requests += 1

def queue_put(self, coverartimage):
"Add an image to queue"
"""Add an image to queue"""
log.debug("Queuing cover art image %r", coverartimage)
self.__queue.append(coverartimage)

def _queue_get(self):
"Get next image and remove it from queue"
"""Get next image and remove it from queue"""
return self.__queue.pop(0)

def _queue_empty(self):
"Returns True if the queue is empty"
"""Returns True if the queue is empty"""
return not self.__queue

def _queue_new(self):
"Initialize the queue"
"""Initialize the queue"""
self.__queue = []

def _message(self, *args, **kwargs):
Expand Down
2 changes: 1 addition & 1 deletion picard/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ def register(self, module, item, priority=PluginPriority.NORMAL):
self.functions[priority].register(module, item)

def run(self, *args, **kwargs):
"Execute registered functions with passed parameters honouring priority"
"""Execute registered functions with passed parameters honouring priority"""
for priority, functions in sorted(self.functions.items(),
key=lambda i: i[0],
reverse=True):
Expand Down
4 changes: 2 additions & 2 deletions picard/util/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ def func_wrapper(*args, **kwargs):


def compare_version_tuples(version1, version2):
'''Compare Versions
"""Compare Versions
Compares two Picard version tuples to determine whether the second tuple
contains a higher version number than the first tuple.
Expand All @@ -527,7 +527,7 @@ def compare_version_tuples(version1, version2):
Raises:
none
'''
"""

# Create test copies that can be modified
test1 = list(version1)
Expand Down
2 changes: 1 addition & 1 deletion picard/util/astrcmp.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@


def astrcmp_py(a, b):
"Calculates the Levenshtein distance between a and b."
"""Calculates the Levenshtein distance between a and b."""
n, m = len(a), len(b)
if n > m:
# Make sure n <= m, to use O(min(n,m)) space
Expand Down
8 changes: 4 additions & 4 deletions picard/util/checkupdate.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def __init__(self, parent=None):
self._update_level = 0

def check_update(self, show_always=False, update_level=0, callback=None):
'''Checks if an update is available.
"""Checks if an update is available.
Compares the version number of the currently running instance of Picard
and displays a dialog box informing the user if an update is available,
Expand All @@ -69,7 +69,7 @@ def check_update(self, show_always=False, update_level=0, callback=None):
Raises:
none.
'''
"""
self._show_always = show_always
self._update_level = update_level

Expand All @@ -81,7 +81,7 @@ def check_update(self, show_always=False, update_level=0, callback=None):
self._query_available_updates(callback=callback)

def _query_available_updates(self, callback=None):
'''Gets list of releases from specified website api.'''
"""Gets list of releases from specified website api."""
log.debug("Getting Picard release information from {host_url}".format(host_url=PLUGINS_API['host'],))
self.tagger.webservice.get(
PLUGINS_API['host'],
Expand All @@ -93,7 +93,7 @@ def _query_available_updates(self, callback=None):
)

def _releases_json_loaded(self, response, reply, error, callback=None):
'''Processes response from specified website api query.'''
"""Processes response from specified website api query."""
if error:
log.error(_("Error loading Picard releases list: {error_message}").format(error_message=reply.errorString(),))
if self._show_always:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ def _explode_path(path):


def _picard_packages():
"Build a tuple containing each module under picard/"
"""Build a tuple containing each module under picard/"""
packages = []
for subdir, dirs, files in os.walk("picard"):
packages.append(".".join(_explode_path(subdir)))
Expand Down
2 changes: 1 addition & 1 deletion test/test_versioncompare.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@


class CompareVersionsTest(PicardTestCase):
'''Unit tests for compare_version_tuples() function.'''
"""Unit tests for compare_version_tuples() function."""

def test_compare_version_01(self):
a, b, r = (0, 0, 1, 'dev', 1), (0, 0, 1, 'dev', 1), 0
Expand Down
2 changes: 1 addition & 1 deletion test/test_versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def test_version_conv_20(self):
self.assertRaises(VersionError, version_from_string, '123.')

def test_api_versions_1(self):
"Check api versions format and order (from oldest to newest)"
"""Check api versions format and order (from oldest to newest)"""
from picard import api_versions

len_api_versions = len(api_versions)
Expand Down

0 comments on commit b7203e4

Please sign in to comment.