submit_try: Obtain the list of trybots from the checked-in slaves.cfg
This should drastically speed up the script.
BUG=
R=epoger@google.com, rmistry@google.com
Author: borenet@google.com
Review URL: https://codereview.chromium.org/136683006
git-svn-id: http://skia.googlecode.com/svn/trunk@13071 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/tools/buildbot_globals.py b/tools/buildbot_globals.py
index 8d0e438..c3d3703 100755
--- a/tools/buildbot_globals.py
+++ b/tools/buildbot_globals.py
@@ -13,6 +13,7 @@
import HTMLParser
import json
+import re
import svn
import sys
import urllib2
@@ -61,12 +62,13 @@
"""
with closing(urllib2.urlopen(url)) as f:
contents = f.read()
- pre_open = '<pre class="git-blob prettyprint linenums lang-json">'
+ pre_open = '<pre class="git-blob prettyprint linenums lang-(\w+)">'
pre_close = '</pre>'
- start_index = contents.find(pre_open)
+ matched_tag = re.search(pre_open, contents).group()
+ start_index = contents.find(matched_tag)
end_index = contents.find(pre_close)
parser = HTMLParser.HTMLParser()
- return parser.unescape(contents[start_index + len(pre_open):end_index])
+ return parser.unescape(contents[start_index + len(matched_tag):end_index])
def Get(var_name):