OLD | NEW |
---|---|
1 # This file is part of Buildbot. Buildbot is free software: you can | 1 # This file is part of Buildbot. Buildbot is free software: you can |
2 # redistribute it and/or modify it under the terms of the GNU General Public | 2 # redistribute it and/or modify it under the terms of the GNU General Public |
3 # License as published by the Free Software Foundation, version 2. | 3 # License as published by the Free Software Foundation, version 2. |
4 # | 4 # |
5 # This program is distributed in the hope that it will be useful, but WITHOUT | 5 # This program is distributed in the hope that it will be useful, but WITHOUT |
6 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | 6 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
7 # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more | 7 # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more |
8 # details. | 8 # details. |
9 # | 9 # |
10 # You should have received a copy of the GNU General Public License along with | 10 # You should have received a copy of the GNU General Public License along with |
(...skipping 623 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
634 for builderName in self.status.getBuilderNames(): | 634 for builderName in self.status.getBuilderNames(): |
635 if self.name in self.status.getBuilder(builderName).slavenames: | 635 if self.name in self.status.getBuilder(builderName).slavenames: |
636 self.builders.append(builderName) | 636 self.builders.append(builderName) |
637 return self.builders | 637 return self.builders |
638 | 638 |
639 def getSlaveBuildMap(self, buildcache, buildercache): | 639 def getSlaveBuildMap(self, buildcache, buildercache): |
640 for builderName in self.getBuilders(): | 640 for builderName in self.getBuilders(): |
641 if builderName not in buildercache: | 641 if builderName not in buildercache: |
642 buildercache.add(builderName) | 642 buildercache.add(builderName) |
643 builder_status = self.status.getBuilder(builderName) | 643 builder_status = self.status.getBuilder(builderName) |
644 for i in range(1, builder_status.buildCacheSize - 1): | 644 |
645 build_status = builder_status.getBuild(-i) | 645 buildnums = range(1, builder_status.buildCacheSize - 1) |
646 buildnums = [-i for i in buildnums] | |
iannucci
2013/07/02 01:15:27
range(-1, -(size - 1), -1)?
Mike Stip (use stip instead)
2013/07/02 02:18:34
Done.
| |
647 | |
648 builds = builder_status.getBuilds(buildnums) | |
649 for build_status in builds: | |
646 if not build_status or not build_status.isFinished(): | 650 if not build_status or not build_status.isFinished(): |
647 # If not finished, it will appear in runningBuilds. | 651 # If not finished, it will appear in runningBuilds. |
648 break | 652 break |
649 slave = buildcache[build_status.getSlavename()] | 653 slave = buildcache[build_status.getSlavename()] |
650 slave.setdefault(builderName, []).append( | 654 slave.setdefault(builderName, []).append( |
651 build_status.getNumber()) | 655 build_status.getNumber()) |
652 return buildcache[self.name] | 656 return buildcache[self.name] |
653 | 657 |
654 def asDict(self, request): | 658 def asDict(self, request): |
655 if not hasattr(request, 'custom_data'): | 659 if not hasattr(request, 'custom_data'): |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
756 if not builder: | 760 if not builder: |
757 return | 761 return |
758 EXAMPLES = EXAMPLES.replace('<A_BUILDER>', builder.getName()) | 762 EXAMPLES = EXAMPLES.replace('<A_BUILDER>', builder.getName()) |
759 build = builder.getBuild(-1) | 763 build = builder.getBuild(-1) |
760 if build: | 764 if build: |
761 EXAMPLES = EXAMPLES.replace('<A_BUILD>', str(build.getNumber())) | 765 EXAMPLES = EXAMPLES.replace('<A_BUILD>', str(build.getNumber())) |
762 if builder.slavenames: | 766 if builder.slavenames: |
763 EXAMPLES = EXAMPLES.replace('<A_SLAVE>', builder.slavenames[0]) | 767 EXAMPLES = EXAMPLES.replace('<A_SLAVE>', builder.slavenames[0]) |
764 | 768 |
765 # vim: set ts=4 sts=4 sw=4 et: | 769 # vim: set ts=4 sts=4 sw=4 et: |
OLD | NEW |