| OLD | NEW |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 from telemetry.page import cache_temperature as cache_temperature_module |
| 4 from telemetry.page import page as page_module | 5 from telemetry.page import page as page_module |
| 5 from telemetry.page import shared_page_state | 6 from telemetry.page import shared_page_state |
| 6 from telemetry import story | 7 from telemetry import story |
| 7 | 8 |
| 8 | 9 |
| 9 class IntlHiRuPage(page_module.Page): | 10 class IntlHiRuPage(page_module.Page): |
| 10 | 11 |
| 11 def __init__(self, url, page_set): | 12 def __init__(self, url, page_set, cache_temperature=None): |
| 12 super(IntlHiRuPage, self).__init__( | 13 super(IntlHiRuPage, self).__init__( |
| 13 url=url, page_set=page_set, | 14 url=url, page_set=page_set, |
| 14 shared_page_state_class=shared_page_state.SharedDesktopPageState) | 15 shared_page_state_class=shared_page_state.SharedDesktopPageState, |
| 16 cache_temperature=cache_temperature) |
| 15 self.archive_data_file = 'data/intl_hi_ru.json' | 17 self.archive_data_file = 'data/intl_hi_ru.json' |
| 16 | 18 |
| 17 | 19 |
| 18 class IntlHiRuPageSet(story.StorySet): | 20 class IntlHiRuPageSet(story.StorySet): |
| 19 | 21 |
| 20 """ Popular pages in Hindi and Russian. """ | 22 """ Popular pages in Hindi and Russian. """ |
| 21 | 23 |
| 22 def __init__(self): | 24 def __init__(self, cache_temperatures=None): |
| 23 super(IntlHiRuPageSet, self).__init__( | 25 super(IntlHiRuPageSet, self).__init__( |
| 24 archive_data_file='data/intl_hi_ru.json', | 26 archive_data_file='data/intl_hi_ru.json', |
| 25 cloud_storage_bucket=story.PARTNER_BUCKET) | 27 cloud_storage_bucket=story.PARTNER_BUCKET) |
| 28 if cache_temperatures is None: |
| 29 cache_temperatures = [cache_temperature_module.ANY] |
| 26 | 30 |
| 27 urls_list = [ | 31 urls_list = [ |
| 28 # Why: #12 site in Russia | 32 # Why: #12 site in Russia |
| 29 'http://www.rambler.ru/', | 33 'http://www.rambler.ru/', |
| 30 'http://apeha.ru/', | 34 'http://apeha.ru/', |
| 31 # pylint: disable=line-too-long | 35 # pylint: disable=line-too-long |
| 32 'http://yandex.ru/yandsearch?lr=102567&text=%D0%9F%D0%BE%D0%B3%D0%BE%D0%B4
%D0%B0', | 36 'http://yandex.ru/yandsearch?lr=102567&text=%D0%9F%D0%BE%D0%B3%D0%BE%D0%B4
%D0%B0', |
| 33 'http://photofile.ru/', | 37 'http://photofile.ru/', |
| 34 'http://ru.wikipedia.org/', | 38 'http://ru.wikipedia.org/', |
| 35 'http://narod.yandex.ru/', | 39 'http://narod.yandex.ru/', |
| 36 # Why: #15 in Russia | 40 # Why: #15 in Russia |
| 37 'http://rutracker.org/forum/index.php', | 41 'http://rutracker.org/forum/index.php', |
| 38 'http://hindi.webdunia.com/', | 42 'http://hindi.webdunia.com/', |
| 39 # Why: #49 site in India | 43 # Why: #49 site in India |
| 40 'http://hindi.oneindia.in/', | 44 'http://hindi.oneindia.in/', |
| 41 # Why: #9 site in India | 45 # Why: #9 site in India |
| 42 'http://www.indiatimes.com/', | 46 'http://www.indiatimes.com/', |
| 43 # Why: #2 site in India | 47 # Why: #2 site in India |
| 44 'http://news.google.co.in/nwshp?tab=in&hl=hi' | 48 'http://news.google.co.in/nwshp?tab=in&hl=hi' |
| 45 ] | 49 ] |
| 46 | 50 |
| 47 for url in urls_list: | 51 for url in urls_list: |
| 48 self.AddStory(IntlHiRuPage(url, self)) | 52 for temp in cache_temperatures: |
| 53 self.AddStory(IntlHiRuPage(url, self, cache_temperature=temp)) |
| OLD | NEW |