[Launchpad-reviewers] [Merge] lp:~maxiberta/launchpad/rename-google-as-sitesearch-extra into lp:launchpad

2018-03-27 Thread noreply
The proposal to merge lp:~maxiberta/launchpad/rename-google-as-sitesearch-extra 
into lp:launchpad has been updated.

Status: Needs review => Merged

For more details, see:
https://code.launchpad.net/~maxiberta/launchpad/rename-google-as-sitesearch-extra/+merge/342148
-- 
Your team Launchpad code reviewers is subscribed to branch lp:launchpad.

___
Mailing list: https://launchpad.net/~launchpad-reviewers
Post to : launchpad-reviewers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~launchpad-reviewers
More help   : https://help.launchpad.net/ListHelp


Re: [Launchpad-reviewers] [Merge] lp:~maxiberta/launchpad/rename-google-as-sitesearch-extra into lp:launchpad

2018-03-27 Thread Colin Watson
Review: Approve


-- 
https://code.launchpad.net/~maxiberta/launchpad/rename-google-as-sitesearch-extra/+merge/342148
Your team Launchpad code reviewers is subscribed to branch lp:launchpad.

___
Mailing list: https://launchpad.net/~launchpad-reviewers
Post to : launchpad-reviewers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~launchpad-reviewers
More help   : https://help.launchpad.net/ListHelp


[Launchpad-reviewers] [Merge] lp:~maxiberta/launchpad/rename-google-as-sitesearch-extra into lp:launchpad

2018-03-26 Thread Maximiliano Bertacchini
Maximiliano Bertacchini has proposed merging 
lp:~maxiberta/launchpad/rename-google-as-sitesearch-extra into lp:launchpad.

Commit message:
A few extra renamed classes from Google* to SiteSearch*.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~maxiberta/launchpad/rename-google-as-sitesearch-extra/+merge/342148

A few extra renamed classes from Google* to SiteSearch*.

- Rename GoogleBatchNavigator as SiteSearchBatchNavigator.
- Rename GoogleResponseError as SiteSearchResponseError.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of 
lp:~maxiberta/launchpad/rename-google-as-sitesearch-extra into lp:launchpad.
=== modified file 'lib/lp/app/browser/root.py'
--- lib/lp/app/browser/root.py	2018-03-16 14:50:01 +
+++ lib/lp/app/browser/root.py	2018-03-26 21:14:59 +
@@ -42,7 +42,7 @@
 from lp.services.memcache.interfaces import IMemcacheClient
 from lp.services.propertycache import cachedproperty
 from lp.services.sitesearch.interfaces import (
-GoogleResponseError,
+SiteSearchResponseError,
 ISearchService,
 )
 from lp.services.statistics.interfaces.statistic import ILaunchpadStatisticSet
@@ -520,14 +520,14 @@
 try:
 page_matches = google_search.search(
 terms=query_terms, start=start)
-except GoogleResponseError:
+except SiteSearchResponseError:
 # There was a connectivity or Google service issue that means
 # there is no data available at this moment.
 self.has_page_service = False
 return None
 if len(page_matches) == 0:
 return None
-navigator = GoogleBatchNavigator(
+navigator = SiteSearchBatchNavigator(
 page_matches, self.request, start=start)
 navigator.setHeadings(*self.batch_heading)
 return navigator
@@ -589,7 +589,7 @@
 return self.start + len(self.list._window)
 
 
-class GoogleBatchNavigator(BatchNavigator):
+class SiteSearchBatchNavigator(BatchNavigator):
 """A batch navigator with a fixed size of 20 items per batch."""
 
 _batch_factory = WindowedListBatch
@@ -614,7 +614,7 @@
 :param callback: Not used.
 """
 results = WindowedList(results, start, results.total)
-super(GoogleBatchNavigator, self).__init__(results, request,
+super(SiteSearchBatchNavigator, self).__init__(results, request,
 start=start, size=size, callback=callback,
 transient_parameters=transient_parameters,
 force_start=force_start, range_factory=range_factory)

=== modified file 'lib/lp/app/browser/tests/launchpad-search-pages.txt'
--- lib/lp/app/browser/tests/launchpad-search-pages.txt	2018-03-16 14:02:16 +
+++ lib/lp/app/browser/tests/launchpad-search-pages.txt	2018-03-26 21:14:59 +
@@ -416,7 +416,7 @@
 >>> search_view.has_matches
 True
 >>> search_view.pages
-<...GoogleBatchNavigator ...>
+<...SiteSearchBatchNavigator ...>
 
 The GoogleSearchService may not be available due to connectivity problems.
 The view's has_page_service attribute reports when the search was performed
@@ -444,7 +444,7 @@
 >>> search_view.batch_heading
 (u'other page matching "launchpad"', u'other pages matching "launchpad"')
 
-The GoogleBatchNavigator behaves like most BatchNavigators, except that
+The SiteSearchBatchNavigator behaves like most BatchNavigators, except that
 its batch size is always 20. The size restriction conforms to Google's
 maximum number of results that can be returned per request.
 
@@ -625,7 +625,7 @@
   
 
 
-WindowedList and GoogleBatchNavigator
+WindowedList and SiteSearchBatchNavigator
 -
 
 The LaunchpadSearchView uses two helper classes to work with
@@ -635,7 +635,7 @@
 or fewer PageMatches of what could be thousands of matches. Google
 requires client's to make repeats request to step though the batches of
 matches. The Windowed list is a list that contains only a subset of its
-reported size. It is used to make batches in the GoogleBatchNavigator.
+reported size. It is used to make batches in the SiteSearchBatchNavigator.
 
 For example, the last batch of the 'bug' search contained 5 of the 25
 matching pages. The WindowList claims to be 25 items in length, but
@@ -657,14 +657,14 @@
 >>> results[18, 22]
 [None, None, <...PageMatch ...>, <...PageMatch ...>]
 
-The GoogleBatchNavigator restricts the batch size to 20. the 'batch'
+The SiteSearchBatchNavigator restricts the batch size to 20. the 'batch'
 parameter that comes from the URL is ignored. For example, setting
 the 'batch' parameter to 100 has no affect upon the Google search
 or on the navigator object.
 
->>> from lp.app.browser.root import GoogleBatchNavigator
+>>> from lp.app.browser.root import SiteSearchBatchNavigator
 
->>> GoogleBatchNavigator.batch_variable_name
+>>>