Chromium Code Reviews| 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) |