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

Side by Side Diff: chrome/test/pyautolib/prefs_info.py

Issue 8680018: Fix python scripts in src/chrome/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: copyright Created 9 years 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/test/pyautolib/plugins_info.py ('k') | chrome/test/pyautolib/pyauto.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python 1 # Copyright (c) 2011 The Chromium Authors. All rights reserved.
2
3 # Copyright (c) 2010 The Chromium Authors. All rights reserved.
4 # 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
5 # found in the LICENSE file. 3 # found in the LICENSE file.
6 4
7 """Python representation for Chromium Preferences. 5 """Python representation for Chromium Preferences.
8 6
9 Obtain one of these from a call to PyUITest::GetPrefsInfo() or 7 Obtain one of these from a call to PyUITest::GetPrefsInfo() or
10 PyUITest::GetLocalStatePrefsInfo(). 8 PyUITest::GetLocalStatePrefsInfo().
11 9
12 Example: 10 Example:
13 class MyTest(pyauto.PyUITest): 11 class MyTest(pyauto.PyUITest):
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 list or a plain value. 91 list or a plain value.
94 None, if prefernece for path not found (if path is given). 92 None, if prefernece for path not found (if path is given).
95 """ 93 """
96 all = self.prefsdict.get('prefs', {}) 94 all = self.prefsdict.get('prefs', {})
97 if not path: # No path given. Return all prefs. 95 if not path: # No path given. Return all prefs.
98 return all 96 return all
99 for part in path.split('.'): # Narrow down to the requested prefs path. 97 for part in path.split('.'): # Narrow down to the requested prefs path.
100 all = all.get(part) 98 all = all.get(part)
101 if all is None: return None 99 if all is None: return None
102 return all 100 return all
OLDNEW
« no previous file with comments | « chrome/test/pyautolib/plugins_info.py ('k') | chrome/test/pyautolib/pyauto.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698