OLD | NEW |
(Empty) | |
| 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. |
| 4 |
| 5 import download |
| 6 from sdk_update_common import Error |
| 7 |
| 8 |
| 9 def AddSource(config, url): |
| 10 try: |
| 11 download.UrlOpen(url) |
| 12 except Exception as e: |
| 13 raise Error('Not adding %s, unable to load URL.\n %s' % (url, e)) |
| 14 config.AddSource(url) |
| 15 |
| 16 |
| 17 def RemoveSource(config, url): |
| 18 if url == 'all': |
| 19 config.RemoveAllSources() |
| 20 else: |
| 21 config.RemoveSource(url) |
| 22 |
| 23 |
| 24 def ListSources(config): |
| 25 if config.sources: |
| 26 print 'Installed sources:' |
| 27 for s in config.sources: |
| 28 print ' ' + s |
| 29 else: |
| 30 print 'No external sources installed.' |
OLD | NEW |