OLD | NEW |
1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2013 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 import json | 4 import json |
5 import logging | 5 import logging |
6 import os | 6 import os |
7 import re | 7 import re |
8 import shutil | 8 import shutil |
9 | 9 |
10 class PageSetArchiveInfo(object): | 10 class PageSetArchiveInfo(object): |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 | 120 |
121 def _SetWprFileForPage(self, page, wpr_file): | 121 def _SetWprFileForPage(self, page, wpr_file): |
122 """For modifying the metadata when we're going to record a new archive.""" | 122 """For modifying the metadata when we're going to record a new archive.""" |
123 old_wpr_file = self._url_to_wpr_file.get(page.url, None) | 123 old_wpr_file = self._url_to_wpr_file.get(page.url, None) |
124 if old_wpr_file: | 124 if old_wpr_file: |
125 self._wpr_file_to_urls[old_wpr_file].remove(page.url) | 125 self._wpr_file_to_urls[old_wpr_file].remove(page.url) |
126 self._url_to_wpr_file[page.url] = wpr_file | 126 self._url_to_wpr_file[page.url] = wpr_file |
127 if wpr_file not in self._wpr_file_to_urls: | 127 if wpr_file not in self._wpr_file_to_urls: |
128 self._wpr_file_to_urls[wpr_file] = [] | 128 self._wpr_file_to_urls[wpr_file] = [] |
129 self._wpr_file_to_urls[wpr_file].append(page.url) | 129 self._wpr_file_to_urls[wpr_file].append(page.url) |
OLD | NEW |