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

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 02d121128962ceb4fc81ffcae8be312d197f2646..e24ec0fb11bf688d3f661f1dc8743a9dca06fbda 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,9 +25,15 @@ class Page(object):
return self.url
class PageSet(object):
- def __init__(self, description='', file_path=''):
+ def __init__(self, description='', file_path='',
nduca 2012/10/02 20:41:49 lets make this take only an attributes=None array
hartmanng 2012/10/02 21:41:06 Done.
+ credentials_path=None):
self.description = description
self.file_path = file_path
+ if credentials_path is None:
+ self.credentials_path = None
+ else:
+ self.credentials_path = os.path.join(os.path.dirname(self.file_path),
+ credentials_path)
self.pages = []
@classmethod
@@ -38,7 +45,7 @@ class PageSet(object):
@classmethod
def FromDict(cls, data, file_path=''):
- page_set = cls(data['description'], file_path)
+ page_set = cls(data['description'], file_path, data.get('credentials_path'))
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