| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 | 2 |
| 3 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 3 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| 4 # for details. All rights reserved. Use of this source code is governed by a | 4 # for details. All rights reserved. Use of this source code is governed by a |
| 5 # BSD-style license that can be found in the LICENSE file. | 5 # BSD-style license that can be found in the LICENSE file. |
| 6 | 6 |
| 7 import datetime | 7 import datetime |
| 8 import math | 8 import math |
| 9 from matplotlib.font_manager import FontProperties | 9 from matplotlib.font_manager import FontProperties |
| 10 import matplotlib.pyplot as plt | 10 import matplotlib.pyplot as plt |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 fontP = FontProperties() | 269 fontP = FontProperties() |
| 270 fontP.set_size('small') | 270 fontP.set_size('small') |
| 271 plt.legend(loc=legend_loc, prop = fontP) | 271 plt.legend(loc=legend_loc, prop = fontP) |
| 272 | 272 |
| 273 fig = plt.gcf() | 273 fig = plt.gcf() |
| 274 fig.set_size_inches(size_x, size_y) | 274 fig.set_size_inches(size_x, size_y) |
| 275 fig.savefig(os.path.join(GRAPH_OUT_DIR, filename)) | 275 fig.savefig(os.path.join(GRAPH_OUT_DIR, filename)) |
| 276 | 276 |
| 277 def add_svn_revision_to_trace(self, outfile): | 277 def add_svn_revision_to_trace(self, outfile): |
| 278 """Add the svn version number to the provided tracefile.""" | 278 """Add the svn version number to the provided tracefile.""" |
| 279 p = subprocess.Popen(['svn', 'info'], stdout = subprocess.PIPE, | 279 def search_for_revision(svn_info_command): |
| 280 stderr = subprocess.STDOUT, shell = HAS_SHELL) | 280 p = subprocess.Popen(svn_info_command, stdout = subprocess.PIPE, |
| 281 output, not_used = p.communicate() | 281 stderr = subprocess.STDOUT, shell = HAS_SHELL) |
| 282 for line in output.split('\n'): | 282 output, _ = p.communicate() |
| 283 if 'Revision' in line: | 283 for line in output.split('\n'): |
| 284 run_cmd(['echo', line.strip()], outfile) | 284 if 'Revision' in line: |
| 285 run_cmd(['echo', line.strip()], outfile) |
| 286 return True |
| 287 return False |
| 288 |
| 289 if not search_for_revision(['svn', 'info']): |
| 290 if not search_for_revision(['git', 'svn', 'info']): |
| 291 run_cmd(['echo', 'Revision: unknown'], outfile) |
| 285 | 292 |
| 286 def write_html(self, delimiter, rev_nums, label_1, dict_1, label_2, dict_2, | 293 def write_html(self, delimiter, rev_nums, label_1, dict_1, label_2, dict_2, |
| 287 cleanFile=False): | 294 cleanFile=False): |
| 288 """Adds an html table to the webpage to display the data values. This method | 295 """Adds an html table to the webpage to display the data values. This method |
| 289 will be removed when we have a nicer way to display data values.""" | 296 will be removed when we have a nicer way to display data values.""" |
| 290 #TODO(efortuna): fix this. | 297 #TODO(efortuna): fix this. |
| 291 return | 298 return |
| 292 #TODO(efortuna): Take this method out when have finalized where the data is | 299 #TODO(efortuna): Take this method out when have finalized where the data is |
| 293 # going to be displayed. | 300 # going to be displayed. |
| 294 f = '' | 301 f = '' |
| (...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 749 while True: | 756 while True: |
| 750 if has_new_code(): | 757 if has_new_code(): |
| 751 run_test_sequence(cl, size, language, perf) | 758 run_test_sequence(cl, size, language, perf) |
| 752 else: | 759 else: |
| 753 time.sleep(SLEEP_TIME) | 760 time.sleep(SLEEP_TIME) |
| 754 else: | 761 else: |
| 755 run_test_sequence(cl, size, language, perf) | 762 run_test_sequence(cl, size, language, perf) |
| 756 | 763 |
| 757 if __name__ == '__main__': | 764 if __name__ == '__main__': |
| 758 main() | 765 main() |
| 759 | |
| OLD | NEW |