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

Unified Diff: native_client_sdk/src/build_tools/sdk_tools/command/sources.py

Issue 11228013: [NaCl SDK] Refactor sdk_update*. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix build_updater Created 8 years, 2 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: native_client_sdk/src/build_tools/sdk_tools/command/sources.py
diff --git a/native_client_sdk/src/build_tools/sdk_tools/command/sources.py b/native_client_sdk/src/build_tools/sdk_tools/command/sources.py
new file mode 100644
index 0000000000000000000000000000000000000000..3a7c975dcaa1c33297d57c7a090d81c1fb13f159
--- /dev/null
+++ b/native_client_sdk/src/build_tools/sdk_tools/command/sources.py
@@ -0,0 +1,29 @@
+# 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.
+
+import download
+from sdk_update_common import Error
+
+def AddSource(config, url):
+ try:
+ download.UrlOpen(url)
+ except Exception as e:
+ raise Error('Not adding %s, unable to load URL.\n %s' % (url, e))
+ config.AddSource(url)
+
+
+def RemoveSource(config, url):
+ if url == 'all':
+ config.RemoveAllSources()
+ else:
+ config.RemoveSource(url)
+
+
+def ListSources(config):
+ if config.sources:
+ print 'Installed sources:'
+ for s in config.sources:
+ print ' ' + s
+ else:
+ print 'No external sources installed.'

Powered by Google App Engine
This is Rietveld 408576698