OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 | 2 |
3 # Copyright 2014 The Chromium Authors. All rights reserved. | 3 # Copyright 2014 The Chromium Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 import argparse | 7 import argparse |
8 import datetime | 8 import datetime |
9 import getpass | 9 import getpass |
10 import json | 10 import json |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 return dict | 105 return dict |
106 | 106 |
107 @staticmethod | 107 @staticmethod |
108 def fromDict(dict): | 108 def fromDict(dict): |
109 gpu_bot = GpuBot(dict['waterfall_name'], dict['bot_name'], None) | 109 gpu_bot = GpuBot(dict['waterfall_name'], dict['bot_name'], None) |
110 | 110 |
111 if 'end_time' in dict: | 111 if 'end_time' in dict: |
112 gpu_bot._end_time = unserializeTime(dict['end_time']) | 112 gpu_bot._end_time = unserializeTime(dict['end_time']) |
113 | 113 |
114 if 'hours_since_last_run' in dict: | 114 if 'hours_since_last_run' in dict: |
115 self._hours_since_last_run = dict['hours_since_last_run'] | 115 gpu_bot._hours_since_last_run = dict['hours_since_last_run'] |
116 | 116 |
117 if 'failure_string' in dict: | 117 if 'failure_string' in dict: |
118 self.failure_string = dict['failure_string'] | 118 gpu_bot.failure_string = dict['failure_string'] |
119 | 119 |
120 if 'bot_url' in dict: | 120 if 'bot_url' in dict: |
121 self.bot_url = dict['bot_url'] | 121 gpu_bot.bot_url = dict['bot_url'] |
122 | 122 |
123 if 'build_url' in dict: | 123 if 'build_url' in dict: |
124 self.build_url = dict['build_url'] | 124 gpu_bot.build_url = dict['build_url'] |
125 | 125 |
126 return gpu_bot | 126 return gpu_bot |
127 | 127 |
128 def errorNoMostRecentBuild(waterfall_name, bot_name): | 128 def errorNoMostRecentBuild(waterfall_name, bot_name): |
129 print 'No most recent build available: %s::%s' % (waterfall_name, bot_name) | 129 print 'No most recent build available: %s::%s' % (waterfall_name, bot_name) |
130 | 130 |
131 class Waterfall: | 131 class Waterfall: |
132 BASE_URL = 'http://build.chromium.org/p/' | 132 BASE_URL = 'http://build.chromium.org/p/' |
133 BASE_BUILD_URL = BASE_URL + '%s/builders/%s' | 133 BASE_BUILD_URL = BASE_URL + '%s/builders/%s' |
134 SPECIFIC_BUILD_URL = BASE_URL + '%s/builders/%s/builds/%s' | 134 SPECIFIC_BUILD_URL = BASE_URL + '%s/builders/%s/builds/%s' |
(...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
641 if args.repeat_delay is None: | 641 if args.repeat_delay is None: |
642 break | 642 break |
643 | 643 |
644 print 'Will run again in %d minutes...\n' % args.repeat_delay | 644 print 'Will run again in %d minutes...\n' % args.repeat_delay |
645 time.sleep(args.repeat_delay * 60) | 645 time.sleep(args.repeat_delay * 60) |
646 | 646 |
647 return 0 | 647 return 0 |
648 | 648 |
649 if __name__ == '__main__': | 649 if __name__ == '__main__': |
650 sys.exit(main(sys.argv)) | 650 sys.exit(main(sys.argv)) |
OLD | NEW |