| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright 2013 The Chromium Authors. All rights reserved. | 2 # Copyright 2013 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 """Code to find swarming_client.""" | 6 """Code to find swarming_client.""" |
| 7 | 7 |
| 8 import os | 8 import os |
| 9 | 9 |
| 10 | 10 |
| 11 def find_client(base_dir): | 11 def find_client(base_dir): |
| 12 """Returns the path to swarming_client if found.""" | 12 """Returns the path to swarming_client if found. |
| 13 |
| 14 |base_dir| will be in general os.getcwd(), so the script is very dependent on |
| 15 CWD. CWD should be the base directory of the checkout. It has always been the |
| 16 case. |
| 17 """ |
| 13 src_swarming_client = os.path.join( | 18 src_swarming_client = os.path.join( |
| 14 base_dir, 'src', 'tools', 'swarming_client') | 19 base_dir, 'src', 'tools', 'swarming_client') |
| 15 if os.path.isdir(src_swarming_client): | 20 if os.path.isdir(src_swarming_client): |
| 16 return src_swarming_client | 21 return src_swarming_client |
| 17 | 22 |
| 18 # This is the previous path. This can be removed around 2013-12-01. | 23 # This is the previous path. This can be removed around 2013-12-01. |
| 19 src_swarm_client = os.path.join(base_dir, 'src', 'tools', 'swarm_client') | 24 src_swarm_client = os.path.join(base_dir, 'src', 'tools', 'swarm_client') |
| 20 if os.path.isdir(src_swarm_client): | 25 if os.path.isdir(src_swarm_client): |
| 21 return src_swarm_client | 26 return src_swarm_client |
| OLD | NEW |