| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # Copyright 2015 The Chromium Authors. All rights reserved. | 2 # Copyright 2015 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 import argparse | |
| 7 import os | 6 import os |
| 8 import sys | 7 import sys |
| 9 | 8 |
| 10 | 9 |
| 11 def _AddToPathIfNeeded(path): | 10 def _AddToPathIfNeeded(path): |
| 12 if path not in sys.path: | 11 if path not in sys.path: |
| 13 sys.path.insert(0, path) | 12 sys.path.insert(0, path) |
| 14 | 13 |
| 15 | 14 |
| 16 def Main(): | 15 def Main(): |
| 17 catapult_path = os.path.abspath(os.path.join( | 16 dashboard_path = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) |
| 18 os.path.dirname(__file__), '..', '..')) | 17 _AddToPathIfNeeded(dashboard_path) |
| 19 parser = argparse.ArgumentParser() | 18 import dashboard |
| 20 parser.add_argument('--appid', default='chromeperf') | |
| 21 parser.add_argument('--service', default=None) | |
| 22 args = parser.parse_args() | |
| 23 | 19 |
| 24 _AddToPathIfNeeded(os.path.join(catapult_path, 'dashboard')) | 20 catapult_path = os.path.dirname(dashboard_path) |
| 25 import dashboard | |
| 26 paths = dashboard.PathsForDeployment() | |
| 27 | |
| 28 _AddToPathIfNeeded(catapult_path) | 21 _AddToPathIfNeeded(catapult_path) |
| 29 from catapult_build import appengine_deploy | 22 from catapult_build import appengine_deploy |
| 30 appengine_deploy.AppcfgUpdate(paths, app_id=args.appid, | 23 |
| 31 service_name=args.service) | 24 appengine_deploy.Deploy(dashboard.PathsForDeployment(), sys.argv[1:]) |
| 32 | 25 |
| 33 | 26 |
| 34 if __name__ == '__main__': | 27 if __name__ == '__main__': |
| 35 Main() | 28 Main() |
| OLD | NEW |