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

Unified Diff: chrome/common/extensions/docs/server2/fetch.py

Issue 10387225: Die build.py, Die: Part 1 (BranchUtility and SubversionFetcher) (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Unit tests Created 8 years, 7 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
Index: chrome/common/extensions/docs/server2/fetch.py
diff --git a/chrome/common/extensions/docs/server2/fetch.py b/chrome/common/extensions/docs/server2/fetch.py
new file mode 100644
index 0000000000000000000000000000000000000000..e6473bb2d16f7cac39b8e411f28154fcdde1f2f0
--- /dev/null
+++ b/chrome/common/extensions/docs/server2/fetch.py
@@ -0,0 +1,20 @@
+# Copyright (c) 2012 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+from google.appengine.api import urlfetch
+
+class FetchException(Exception):
+ """Thrown when status code is not 200.
+ """
+ def __init__(self, url):
+ Exception.__init__(self, 'Fetch exception from ' + url)
+
+def Fetch(url):
+ result = urlfetch.fetch(
+ url="http://omahaproxy.appspot.com/json",
Aaron Boodman 2012/05/22 22:45:02 I don't think this or the stuff in google/appengin
cduvall 2012/05/24 00:15:40 Much better, good idea.
+ method=urlfetch.GET)
+
+ if result.status_code != 200:
+ raise FetchException(url)
+ return result.content

Powered by Google App Engine
This is Rietveld 408576698