Skip to content

Commit 212be7e

Browse files
alexwlchanagjohnson
authored andcommitted
Docstring/PEP 257 fixes for the search app (#2824)
1 parent dabe447 commit 212be7e

File tree

4 files changed

+8
-15
lines changed

4 files changed

+8
-15
lines changed

readthedocs/search/indexes.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323

2424

2525
class Index(object):
26-
"""
27-
Base class to define some common methods across indexes.
28-
"""
26+
27+
"""Base class to define some common methods across indexes."""
28+
2929
# The _index and _type define the URL path to Elasticsearch, e.g.:
3030
# http://localhost:9200/{_index}/{_type}/_search
3131
_index = 'readthedocs'
@@ -166,15 +166,11 @@ def delete_document(self, body, index=None, parent=None, routing=None):
166166
return self.es.delete_by_query(**kwargs)
167167

168168
def get_mapping(self):
169-
"""
170-
Returns the mapping for this _index and _type.
171-
"""
169+
"""Returns the mapping for this _index and _type."""
172170
raise NotImplementedError()
173171

174172
def extract_document(self, data):
175-
"""
176-
Extracts the Elasticsearch document for this object instance.
177-
"""
173+
"""Extracts the Elasticsearch document for this object instance."""
178174
raise NotImplementedError()
179175

180176
def update_aliases(self, new_index, delete=True):

readthedocs/search/parse_json.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@
1212

1313

1414
def process_all_json_files(version, build_dir=True):
15-
"""
16-
Return a list of pages to index
17-
"""
15+
"""Return a list of pages to index"""
1816
if build_dir:
1917
full_path = version.project.full_json_path(version.slug)
2018
else:

readthedocs/search/utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ def parse_content_from_file(documentation_type, file_path):
114114
def parse_content(documentation_type, content):
115115
"""
116116
Prepare the text of the html file.
117+
117118
Returns the body text of a document
118119
"""
119120
try:

readthedocs/search/views.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@
1515

1616

1717
def elastic_search(request):
18-
"""
19-
Use elastic search for global search
20-
"""
18+
"""Use Elasticsearch for global search"""
2119

2220
query = request.GET.get('q')
2321
type = request.GET.get('type', 'project')

0 commit comments

Comments
 (0)