Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Unified Diff: tools/chrome_remote_control/chrome_remote_control/page_set.py

Issue 11361165: [chrome_remote_control] Rename chrome_remote_control to telemetry. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tools/chrome_remote_control/chrome_remote_control/page_set.py
diff --git a/tools/chrome_remote_control/chrome_remote_control/page_set.py b/tools/chrome_remote_control/chrome_remote_control/page_set.py
deleted file mode 100644
index ea431753ac1418050946d15bc61cc494cd42d9f0..0000000000000000000000000000000000000000
--- a/tools/chrome_remote_control/chrome_remote_control/page_set.py
+++ /dev/null
@@ -1,57 +0,0 @@
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-import json
-import os
-import urlparse
-
-from chrome_remote_control import page as page_module
-
-class PageSet(object):
- def __init__(self, base_dir='', attributes=None):
- self.description = ''
- self.archive_path = ''
- self.base_dir = base_dir
- self.credentials_path = None
-
- if attributes:
- for k, v in attributes.iteritems():
- setattr(self, k, v)
-
- self.pages = []
-
- @classmethod
- def FromFile(cls, file_path):
- with open(file_path, 'r') as f:
- contents = f.read()
- data = json.loads(contents)
- return cls.FromDict(data, os.path.dirname(file_path))
-
- @classmethod
- def FromDict(cls, data, file_path=''):
- page_set = cls(file_path, data)
- for page_attributes in data['pages']:
- url = page_attributes.pop('url')
- page = page_module.Page(url, attributes=page_attributes,
- base_dir=file_path)
- page_set.pages.append(page)
- return page_set
-
- def ContainsOnlyFileURLs(self):
- for page in self.pages:
- parsed_url = urlparse.urlparse(page.url)
- if parsed_url.scheme != 'file':
- return False
- return True
-
- def __iter__(self):
- return self.pages.__iter__()
-
- def __len__(self):
- return len(self.pages)
-
- def __getitem__(self, key):
- return self.pages[key]
-
- def __setitem__(self, key, value):
- self.pages[key] = value

Powered by Google App Engine
This is Rietveld 408576698