sorting of developer names
This commit is contained in:
@ -458,7 +458,7 @@ def create_entry_content(entry):
|
||||
|
||||
# we automatically sort some fields
|
||||
sort_fun = lambda x: str.casefold(x.value)
|
||||
for field in ('Media', 'Inspiration', 'Code Language'):
|
||||
for field in ('Media', 'Inspiration', 'Code Language', 'Developer', 'Build system'):
|
||||
if field in entry:
|
||||
values = entry[field]
|
||||
entry[field] = sorted(values, key=sort_fun)
|
||||
|
@ -4,6 +4,7 @@ Using https://github.com/goldsmith/Wikipedia
|
||||
"""
|
||||
|
||||
import wikipedia
|
||||
wikipedia.set_lang('en') # just in case that isn't so already
|
||||
|
||||
|
||||
def search(search_term, results=3):
|
||||
@ -13,4 +14,12 @@ def search(search_term, results=3):
|
||||
:param max_results:
|
||||
:return:
|
||||
"""
|
||||
return wikipedia.search(search_term, results=results)
|
||||
return wikipedia.search(search_term, results=results)
|
||||
|
||||
|
||||
def pages(titles):
|
||||
pages = []
|
||||
for title in titles:
|
||||
page = wikipedia.page(title, auto_suggest=False)
|
||||
pages.append(page)
|
||||
return pages
|
||||
|
Reference in New Issue
Block a user