Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(324)

Unified Diff: tools/buildbot_globals.py

Issue 136683006: submit_try: Obtain the list of trybots from the checked-in slaves.cfg (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rebase Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/submit_try » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/buildbot_globals.py
diff --git a/tools/buildbot_globals.py b/tools/buildbot_globals.py
index 8d0e43897b7290d14f129afa964b8e34952f5bdf..c3d370308edb7613072a0239976fe698befa7fee 100755
--- a/tools/buildbot_globals.py
+++ b/tools/buildbot_globals.py
@@ -13,6 +13,7 @@ from contextlib import closing
import HTMLParser
import json
+import re
import svn
import sys
import urllib2
@@ -61,12 +62,13 @@ def retrieve_from_googlesource(url):
"""
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):
« no previous file with comments | « no previous file | tools/submit_try » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698