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

Side by Side Diff: appengine/swarming/server/task_pack.py

Issue 2013943002: Changing license header, again! (Closed) Base URL: git@github.com:luci/luci-py.git@master
Patch Set: Fixed third parties Created 4 years, 7 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
« no previous file with comments | « appengine/swarming/server/stats_test.py ('k') | appengine/swarming/server/task_pack_test.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 # coding: utf-8 1 # coding: utf-8
2 # Copyright 2015 The LUCI Authors. All rights reserved. 2 # Copyright 2015 The LUCI Authors. All rights reserved.
3 # Use of this source code is governed by the Apache v2.0 license that can be 3 # Use of this source code is governed under the Apache License, Version 2.0
4 # found in the LICENSE file. 4 # that can be found in the LICENSE file.
5 5
6 """Packing and unpacking of ndb.Key. 6 """Packing and unpacking of ndb.Key.
7 7
8 End users are only given packed keys, which permits to not expose internal 8 End users are only given packed keys, which permits to not expose internal
9 schema details to the user. 9 schema details to the user.
10 """ 10 """
11 11
12 from google.appengine.ext import ndb 12 from google.appengine.ext import ndb
13 13
14 from components import datastore_utils 14 from components import datastore_utils
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 """Returns the TaskRunResult ndb.Key from a packed key. 167 """Returns the TaskRunResult ndb.Key from a packed key.
168 168
169 The expected format of |packed_key| is %x. 169 The expected format of |packed_key| is %x.
170 """ 170 """
171 request_key = unpack_request_key(packed_key[:-1]) 171 request_key = unpack_request_key(packed_key[:-1])
172 run_id = int(packed_key[-1], 16) 172 run_id = int(packed_key[-1], 16)
173 if not run_id: 173 if not run_id:
174 raise ValueError('Can\'t reference to the overall task result.') 174 raise ValueError('Can\'t reference to the overall task result.')
175 result_summary_key = request_key_to_result_summary_key(request_key) 175 result_summary_key = request_key_to_result_summary_key(request_key)
176 return result_summary_key_to_run_result_key(result_summary_key, run_id) 176 return result_summary_key_to_run_result_key(result_summary_key, run_id)
OLDNEW
« no previous file with comments | « appengine/swarming/server/stats_test.py ('k') | appengine/swarming/server/task_pack_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698