Merge lp:~maxiberta/launchpad/rename-googlesearch-as-sitesearch into lp:launchpad

Proposed by Maximiliano Bertacchini
Status: Merged
Merged at revision: 18572
Proposed branch: lp:~maxiberta/launchpad/rename-googlesearch-as-sitesearch
Merge into: lp:launchpad
Diff against target: 314 lines (+33/-35)
16 files modified
lib/lp/app/browser/root.py (+3/-3)
lib/lp/app/browser/tests/launchpad-search-pages.txt (+1/-1)
lib/lp/scripts/runlaunchpad.py (+1/-1)
lib/lp/services/config/schema-lazr.conf (+2/-4)
lib/lp/services/configure.zcml (+1/-1)
lib/lp/services/sitesearch/__init__.py (+1/-1)
lib/lp/services/sitesearch/configure.zcml (+7/-7)
lib/lp/services/sitesearch/doc/google-searchservice.txt (+5/-5)
lib/lp/services/sitesearch/doc/google-service-stub.txt.disabled (+1/-1)
lib/lp/services/sitesearch/tests/googleserviceharness.py (+2/-2)
lib/lp/services/sitesearch/tests/test_google.py (+2/-2)
lib/lp/services/sitesearch/tests/test_googleharness.py (+1/-1)
lib/lp/services/sitesearch/tests/test_googleservice.py (+1/-1)
lib/lp/services/sitesearch/tests/test_pagematch.py (+1/-1)
lib/lp/testing/layers.py (+3/-3)
setup.py (+1/-1)
To merge this branch: bzr merge lp:~maxiberta/launchpad/rename-googlesearch-as-sitesearch
Reviewer Review Type Date Requested Status
Colin Watson (community) Approve
Review via email: mp+341521@code.launchpad.net

Commit message

Rename lp.services.googlesearch as lp.services.sitesearch.

Description of the change

Rename lp.services.googlesearch as lp.services.sitesearch. This is the first step towards migrating the site search to Bing Custom Search.

To post a comment you must log in.
Revision history for this message
Colin Watson (cjwatson) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/app/browser/root.py'
2--- lib/lp/app/browser/root.py 2017-11-18 13:29:18 +0000
3+++ lib/lp/app/browser/root.py 2018-03-16 14:56:41 +0000
4@@ -39,12 +39,12 @@
5 from lp.registry.interfaces.product import IProductSet
6 from lp.services.config import config
7 from lp.services.features import getFeatureFlag
8-from lp.services.googlesearch.interfaces import (
9+from lp.services.memcache.interfaces import IMemcacheClient
10+from lp.services.propertycache import cachedproperty
11+from lp.services.sitesearch.interfaces import (
12 GoogleResponseError,
13 ISearchService,
14 )
15-from lp.services.memcache.interfaces import IMemcacheClient
16-from lp.services.propertycache import cachedproperty
17 from lp.services.statistics.interfaces.statistic import ILaunchpadStatisticSet
18 from lp.services.timeout import urlfetch
19 from lp.services.webapp import LaunchpadView
20
21=== modified file 'lib/lp/app/browser/tests/launchpad-search-pages.txt'
22--- lib/lp/app/browser/tests/launchpad-search-pages.txt 2018-02-02 10:02:16 +0000
23+++ lib/lp/app/browser/tests/launchpad-search-pages.txt 2018-03-16 14:56:41 +0000
24@@ -642,7 +642,7 @@
25 the first 20 items are None. Only the last 5 items are PageMatches.
26
27 >>> from lp.app.browser.root import WindowedList
28- >>> from lp.services.googlesearch import GoogleSearchService
29+ >>> from lp.services.sitesearch import GoogleSearchService
30
31 >>> google_search = GoogleSearchService()
32 >>> page_matches = google_search.search(terms='bug', start=20)
33
34=== modified file 'lib/lp/scripts/runlaunchpad.py'
35--- lib/lp/scripts/runlaunchpad.py 2017-12-19 17:16:38 +0000
36+++ lib/lp/scripts/runlaunchpad.py 2018-03-16 14:56:41 +0000
37@@ -19,7 +19,6 @@
38
39 from lp.services.config import config
40 from lp.services.daemons import tachandler
41-from lp.services.googlesearch import googletestservice
42 from lp.services.mailman import runmailman
43 from lp.services.osutils import ensure_directory_exists
44 from lp.services.pidfile import (
45@@ -27,6 +26,7 @@
46 pidfile_path,
47 )
48 from lp.services.rabbit.server import RabbitServer
49+from lp.services.sitesearch import googletestservice
50 from lp.services.txlongpoll.server import TxLongPollServer
51
52
53
54=== modified file 'lib/lp/services/config/schema-lazr.conf'
55--- lib/lp/services/config/schema-lazr.conf 2018-01-31 01:19:06 +0000
56+++ lib/lp/services/config/schema-lazr.conf 2018-03-16 14:56:41 +0000
57@@ -763,15 +763,14 @@
58 distroseries: experimental
59 pocketrelease: experimental
60
61-
62 [google_test_service]
63 # Run a web service stub that simulates the Google search service.
64
65 # Where are our canned XML responses stored?
66-canned_response_directory: lib/lp/services/googlesearch/tests/data/
67+canned_response_directory: lib/lp/services/sitesearch/tests/data/
68
69 # Which file maps service URLs to the XML that the server returns?
70-mapfile: lib/lp/services/googlesearch/tests/data/mapping.txt
71+mapfile: lib/lp/services/sitesearch/tests/data/googlesearchservice-mapping.txt
72
73 # Where should the service log files live?
74 log: logs/google-stub.log
75@@ -779,7 +778,6 @@
76 # Do we actually want to run the service?
77 launch: False
78
79-
80 [google]
81 # client_id is the unique id Launchpad was issued by Google.
82 # datatype: string
83
84=== modified file 'lib/lp/services/configure.zcml'
85--- lib/lp/services/configure.zcml 2015-09-18 01:32:20 +0000
86+++ lib/lp/services/configure.zcml 2018-03-16 14:56:41 +0000
87@@ -11,7 +11,6 @@
88 <include package=".feeds" />
89 <include package=".fields" />
90 <include package=".geoip" />
91- <include package=".googlesearch" />
92 <include package=".gpg" />
93 <include package=".identity" />
94 <include package=".inlinehelp" file="meta.zcml" />
95@@ -28,6 +27,7 @@
96 <include package=".salesforce" />
97 <include package=".scripts" />
98 <include package=".session" />
99+ <include package=".sitesearch" />
100 <include package=".statistics" />
101 <include package=".temporaryblobstorage" />
102 <include package=".verification" />
103
104=== renamed directory 'lib/lp/services/googlesearch' => 'lib/lp/services/sitesearch'
105=== modified file 'lib/lp/services/sitesearch/__init__.py'
106--- lib/lp/services/googlesearch/__init__.py 2016-04-19 14:23:22 +0000
107+++ lib/lp/services/sitesearch/__init__.py 2018-03-16 14:56:41 +0000
108@@ -24,7 +24,7 @@
109 from zope.interface import implementer
110
111 from lp.services.config import config
112-from lp.services.googlesearch.interfaces import (
113+from lp.services.sitesearch.interfaces import (
114 GoogleResponseError,
115 GoogleWrongGSPVersion,
116 ISearchResult,
117
118=== modified file 'lib/lp/services/sitesearch/configure.zcml'
119--- lib/lp/services/googlesearch/configure.zcml 2011-03-07 16:32:12 +0000
120+++ lib/lp/services/sitesearch/configure.zcml 2018-03-16 14:56:41 +0000
121@@ -6,18 +6,18 @@
122 xmlns="http://namespaces.zope.org/zope">
123
124 <class
125- class="lp.services.googlesearch.PageMatch">
126- <allow interface="lp.services.googlesearch.interfaces.ISearchResult" />
127+ class="lp.services.sitesearch.PageMatch">
128+ <allow interface="lp.services.sitesearch.interfaces.ISearchResult" />
129 </class>
130
131 <class
132- class="lp.services.googlesearch.PageMatches">
133- <allow interface="lp.services.googlesearch.interfaces.ISearchResults" />
134+ class="lp.services.sitesearch.PageMatches">
135+ <allow interface="lp.services.sitesearch.interfaces.ISearchResults" />
136 </class>
137
138 <securedutility
139- class="lp.services.googlesearch.GoogleSearchService"
140- provides="lp.services.googlesearch.interfaces.ISearchService">
141- <allow interface="lp.services.googlesearch.interfaces.ISearchService" />
142+ class="lp.services.sitesearch.GoogleSearchService"
143+ provides="lp.services.sitesearch.interfaces.ISearchService">
144+ <allow interface="lp.services.sitesearch.interfaces.ISearchService" />
145 </securedutility>
146 </configure>
147
148=== modified file 'lib/lp/services/sitesearch/doc/google-searchservice.txt'
149--- lib/lp/services/googlesearch/doc/google-searchservice.txt 2015-03-11 11:59:27 +0000
150+++ lib/lp/services/sitesearch/doc/google-searchservice.txt 2018-03-16 14:56:41 +0000
151@@ -20,7 +20,7 @@
152
153 >>> from zope.component import getUtility
154 >>> from zope.interface.verify import verifyObject
155- >>> from lp.services.googlesearch.interfaces import (
156+ >>> from lp.services.sitesearch.interfaces import (
157 ... ISearchService)
158
159 >>> google_search = getUtility(ISearchService)
160@@ -38,7 +38,7 @@
161 argument of start. The terms are the same as the text that would be
162 entered in Google search form; the terms should not be escaped.
163
164- >>> from lp.services.googlesearch.interfaces import (
165+ >>> from lp.services.sitesearch.interfaces import (
166 ... ISearchResults)
167
168 >>> first_page_matches = google_search.search(terms='bug')
169@@ -127,8 +127,8 @@
170 set. It is created by passing a title, url, and a summary. It is
171 an implementation of ISearchResult.
172
173- >>> from lp.services.googlesearch.interfaces import ISearchResult
174- >>> from lp.services.googlesearch import PageMatch
175+ >>> from lp.services.sitesearch.interfaces import ISearchResult
176+ >>> from lp.services.sitesearch import PageMatch
177
178 >>> page_match = PageMatch(
179 ... u'Unicode Titles in Launchpad',
180@@ -161,7 +161,7 @@
181 configuration may set a testing site.
182
183 >>> from lp.services.config import config
184- >>> from lp.services.googlesearch import GoogleSearchService
185+ >>> from lp.services.sitesearch import GoogleSearchService
186
187 >>> google_search = GoogleSearchService()
188 >>> config.google.site == google_search.site
189
190=== modified file 'lib/lp/services/sitesearch/doc/google-service-stub.txt.disabled'
191--- lib/lp/services/googlesearch/doc/google-service-stub.txt.disabled 2011-12-29 05:29:36 +0000
192+++ lib/lp/services/sitesearch/doc/google-service-stub.txt.disabled 2018-03-16 14:56:41 +0000
193@@ -14,7 +14,7 @@
194 determines which XML files will be returned when a specific URL is
195 accessed.
196
197- >>> from lp.services.googlesearch.googletestservice import (
198+ >>> from lp.services.sitesearch.googletestservice import (
199 ... url_to_xml_map)
200 >>> routes = url_to_xml_map()
201
202
203=== renamed file 'lib/lp/services/googlesearch/tests/data/mapping.txt' => 'lib/lp/services/sitesearch/tests/data/googlesearchservice-mapping.txt'
204=== modified file 'lib/lp/services/sitesearch/tests/googleserviceharness.py'
205--- lib/lp/services/googlesearch/tests/googleserviceharness.py 2012-06-29 08:40:05 +0000
206+++ lib/lp/services/sitesearch/tests/googleserviceharness.py 2018-03-16 14:56:41 +0000
207@@ -14,7 +14,7 @@
208 import os
209 import signal
210
211-from lp.services.googlesearch import googletestservice
212+from lp.services.sitesearch import googletestservice
213
214
215 class GoogleServiceTestSetup:
216@@ -27,7 +27,7 @@
217 # to the docstring above. Note that the test that uses this setup,
218 # google-service-stub.txt, is also disabled. See test_doc.py.
219 """
220- >>> from lp.services.googlesearch.googletestservice import (
221+ >>> from lp.services.sitesearch.googletestservice import (
222 ... service_is_available)
223 >>> from lp.services.config import config
224
225
226=== modified file 'lib/lp/services/sitesearch/tests/test_google.py'
227--- lib/lp/services/googlesearch/tests/test_google.py 2016-04-19 14:23:22 +0000
228+++ lib/lp/services/sitesearch/tests/test_google.py 2018-03-16 14:56:41 +0000
229@@ -12,8 +12,8 @@
230 HTTPError,
231 )
232
233-from lp.services.googlesearch import GoogleSearchService
234-from lp.services.googlesearch.interfaces import GoogleResponseError
235+from lp.services.sitesearch import GoogleSearchService
236+from lp.services.sitesearch.interfaces import GoogleResponseError
237 from lp.services.timeout import TimeoutError
238 from lp.testing import TestCase
239 from lp.testing.layers import LaunchpadFunctionalLayer
240
241=== modified file 'lib/lp/services/sitesearch/tests/test_googleharness.py'
242--- lib/lp/services/googlesearch/tests/test_googleharness.py 2011-03-07 16:32:12 +0000
243+++ lib/lp/services/sitesearch/tests/test_googleharness.py 2018-03-16 14:56:41 +0000
244@@ -6,5 +6,5 @@
245
246 def test_suite():
247 return doctest.DocTestSuite(
248- 'lp.services.googlesearch.tests.googleserviceharness',
249+ 'lp.services.sitesearch.tests.googleserviceharness',
250 optionflags=doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS)
251
252=== modified file 'lib/lp/services/sitesearch/tests/test_googleservice.py'
253--- lib/lp/services/googlesearch/tests/test_googleservice.py 2018-01-02 10:54:31 +0000
254+++ lib/lp/services/sitesearch/tests/test_googleservice.py 2018-03-16 14:56:41 +0000
255@@ -12,8 +12,8 @@
256 import os
257 import unittest
258
259-from lp.services.googlesearch import googletestservice
260 from lp.services.pidfile import pidfile_path
261+from lp.services.sitesearch import googletestservice
262
263
264 class TestServiceUtilities(unittest.TestCase):
265
266=== modified file 'lib/lp/services/sitesearch/tests/test_pagematch.py'
267--- lib/lp/services/googlesearch/tests/test_pagematch.py 2012-01-01 02:58:52 +0000
268+++ lib/lp/services/sitesearch/tests/test_pagematch.py 2018-03-16 14:56:41 +0000
269@@ -5,7 +5,7 @@
270
271 __metaclass__ = type
272
273-from lp.services.googlesearch import PageMatch
274+from lp.services.sitesearch import PageMatch
275 from lp.testing import TestCaseWithFactory
276 from lp.testing.layers import DatabaseFunctionalLayer
277
278
279=== modified file 'lib/lp/testing/layers.py'
280--- lib/lp/testing/layers.py 2016-12-22 16:32:38 +0000
281+++ lib/lp/testing/layers.py 2018-03-16 14:56:41 +0000
282@@ -113,9 +113,6 @@
283 )
284 from lp.services.database.interfaces import IStore
285 from lp.services.database.sqlbase import session_store
286-from lp.services.googlesearch.tests.googleserviceharness import (
287- GoogleServiceTestSetup,
288- )
289 from lp.services.job.tests import celery_worker
290 from lp.services.librarian.model import LibraryFileAlias
291 from lp.services.librarianserver.testing.server import LibrarianServerFixture
292@@ -129,6 +126,9 @@
293 from lp.services.osutils import kill_by_pidfile
294 from lp.services.rabbit.server import RabbitServer
295 from lp.services.scripts import execute_zcml_for_scripts
296+from lp.services.sitesearch.tests.googleserviceharness import (
297+ GoogleServiceTestSetup,
298+ )
299 from lp.services.testing.profiled import profiled
300 from lp.services.timeout import (
301 get_default_timeout_function,
302
303=== modified file 'setup.py'
304--- setup.py 2018-02-26 12:22:07 +0000
305+++ setup.py 2018-03-16 14:56:41 +0000
306@@ -288,7 +288,7 @@
307 'lp.services.twistedsupport.plugincache:main',
308 'combine-css = lp.scripts.utilities.js.combinecss:main',
309 'googletestservice = '
310- 'lp.services.googlesearch.googletestservice:main',
311+ 'lp.services.sitesearch.googletestservice:main',
312 'harness = lp.scripts.harness:python',
313 'iharness = lp.scripts.harness:ipython',
314 'ipy = IPython.frontend.terminal.ipapp:launch_new_instance',