forked from openlp/openlp
pep8 fixes
This commit is contained in:
parent
1dfad12edc
commit
faa434d937
@ -295,7 +295,7 @@ class SongMediaItem(MediaManagerItem):
|
|||||||
:param search_keywords: A list of search keywords - book first, then number
|
:param search_keywords: A list of search keywords - book first, then number
|
||||||
:return: None
|
:return: None
|
||||||
"""
|
"""
|
||||||
|
|
||||||
log.debug('display results Book')
|
log.debug('display results Book')
|
||||||
self.list_view.clear()
|
self.list_view.clear()
|
||||||
|
|
||||||
@ -700,7 +700,7 @@ class SongMediaItem(MediaManagerItem):
|
|||||||
:param s: A string value from the list we want to sort.
|
:param s: A string value from the list we want to sort.
|
||||||
"""
|
"""
|
||||||
return [int(text) if text.isdecimal() else text.lower()
|
return [int(text) if text.isdecimal() else text.lower()
|
||||||
for text in re.split('(\d+)', s)]
|
for text in re.split('(\d+)', s)]
|
||||||
|
|
||||||
def search(self, string, show_error):
|
def search(self, string, show_error):
|
||||||
"""
|
"""
|
||||||
|
@ -422,10 +422,10 @@ class TestMediaItem(TestCase, TestMixin):
|
|||||||
"""
|
"""
|
||||||
# GIVEN: A string to be converted into a sort key
|
# GIVEN: A string to be converted into a sort key
|
||||||
string_sort_key = 'A1B12C'
|
string_sort_key = 'A1B12C'
|
||||||
|
|
||||||
# WHEN: We attempt to create a sort key
|
# WHEN: We attempt to create a sort key
|
||||||
sort_key_result = self.media_item._natural_sort_key(string_sort_key)
|
sort_key_result = self.media_item._natural_sort_key(string_sort_key)
|
||||||
|
|
||||||
# THEN: We should get back a tuple split on integers
|
# THEN: We should get back a tuple split on integers
|
||||||
self.assertEqual(sort_key_result, ['a', 1, 'b', 12, 'c'])
|
self.assertEqual(sort_key_result, ['a', 1, 'b', 12, 'c'])
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user