Permalink
Browse files

changed code formatting for switch, hopefully it's more readable

Change-Id: If79c2cc98e642b1f6e9704d029d0ac986cac36a8
  • Loading branch information...
1 parent 65a2ede commit 8f72b1dd024ac7e837625660d84f4c3a5f7a344f @a8 a8 committed Jun 23, 2012
Showing with 12 additions and 14 deletions.
  1. +12 −14 codespeed/api.py
View
@@ -211,20 +211,18 @@ def _populate_obj_by_data(self):
get everything except the result, 2nd try reverse lookup
"""
def populate(key):
- return {
- 'project': lambda: ProjectResource().get_via_uri(
- self.data['project']),
- 'executable': lambda: ExecutableResource().get_via_uri(
- self.data['executable']),
- 'benchmark': lambda: BenchmarkResource().get_via_uri(
- self.data['benchmark']),
- 'environment': lambda: EnvironmentResource().get_via_uri(
- self.data['environment']),
- 'branch': lambda: BranchResource().get_via_uri(
- self.data['branch']),
- 'revision': lambda: RevisionResource().get_via_uri(
- self.data['commitid']),
- }.get(key, None)()
+ return {'project': lambda: ProjectResource().get_via_uri(
+ self.data['project']),
+ 'executable': lambda: ExecutableResource().get_via_uri(
+ self.data['executable']),
+ 'benchmark': lambda: BenchmarkResource().get_via_uri(
+ self.data['benchmark']),
+ 'environment': lambda: EnvironmentResource().get_via_uri(
+ self.data['environment']),
+ 'branch': lambda: BranchResource().get_via_uri(
+ self.data['branch']),
+ 'revision': lambda: RevisionResource().get_via_uri(
+ self.data['commitid']),}.get(key, None)()
try:
self.obj.value = float(self.data['result_value'])

0 comments on commit 8f72b1d

Please sign in to comment.