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

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

Issue 10914237: Port perf.py's _LoginToGoogleAccount to chrome_remote_control (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 months 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
index b96f1201ef7853e3649c77acb922e0cc95573086..3d591df19011b556f7630ea20ce10eed5c9fd795 100644
--- a/tools/chrome_remote_control/chrome_remote_control/page_set.py
+++ b/tools/chrome_remote_control/chrome_remote_control/page_set.py
@@ -3,6 +3,7 @@
# found in the LICENSE file.
import json
import urlparse
+import os
class Page(object):
def __init__(self, url, attributes=None):
@@ -24,10 +25,20 @@ class Page(object):
return self.url
class PageSet(object):
- def __init__(self, description='', archive_path='', file_path=''):
- self.description = description
- self.archive_path = archive_path
+ def __init__(self, file_path='', attributes=None):
+ self.description = ''
+ self.archive_path = ''
self.file_path = file_path
+ self.credentials_path = None
+
+ if attributes:
+ for k, v in attributes.iteritems():
+ setattr(self, k, v)
+
+ if self.credentials_path is not None:
+ self.credentials_path = os.path.join(os.path.dirname(self.file_path),
+ self.credentials_path)
+
self.pages = []
@classmethod
@@ -39,7 +50,7 @@ class PageSet(object):
@classmethod
def FromDict(cls, data, file_path=''):
- page_set = cls(data['description'], data['archive_path'], file_path)
+ page_set = cls(file_path, data)
for page_attributes in data['pages']:
url = page_attributes.pop('url')
page = Page(url, page_attributes)

Powered by Google App Engine
This is Rietveld 408576698