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

Side by Side Diff: appengine/swarming/swarming_bot/api/platforms/common.py

Issue 1860863002: Update copyright notice from Swarming to LUCI; add AUTHORS and CONTRIBUTORS. (Closed) Base URL: git@github.com:luci/luci-py.git@master
Patch Set: . Created 4 years, 8 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 unified diff | Download patch
OLDNEW
1 # Copyright 2016 The Swarming Authors. All rights reserved. 1 # Copyright 2016 The LUCI Authors. All rights reserved.
2 # Use of this source code is governed by the Apache v2.0 license that can be 2 # Use of this source code is governed by the Apache v2.0 license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """Common code for platforms.""" 5 """Common code for platforms."""
6 6
7 7
8 def _safe_parse(content, split=': '): 8 def _safe_parse(content, split=': '):
9 """Safely parse a 'key: value' list of strings from a command.""" 9 """Safely parse a 'key: value' list of strings from a command."""
10 values = {} 10 values = {}
11 for l in content.splitlines(): 11 for l in content.splitlines():
12 if not l: 12 if not l:
13 continue 13 continue
14 parts = l.split(split, 2) 14 parts = l.split(split, 2)
15 if len(parts) != 2: 15 if len(parts) != 2:
16 continue 16 continue
17 values.setdefault( 17 values.setdefault(
18 parts[0].strip().decode('utf-8'), parts[1].decode('utf-8')) 18 parts[0].strip().decode('utf-8'), parts[1].decode('utf-8'))
19 return values 19 return values
OLDNEW
« no previous file with comments | « appengine/swarming/swarming_bot/api/platforms/android.py ('k') | appengine/swarming/swarming_bot/api/platforms/gce.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698