[grilo] python: add trivial error handling to grilo-test-ui
- From: Simón Pena <spenap src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [grilo] python: add trivial error handling to grilo-test-ui
- Date: Tue, 21 Dec 2010 08:14:12 +0000 (UTC)
commit 07519ba327ff0406786fdc11cdb40d8f223dad38
Author: Simon Pena <spena igalia com>
Date: Mon Dec 20 17:30:11 2010 +0100
python: add trivial error handling to grilo-test-ui
Some trivial error handling is added to Python's grilo-test-ui
since currently these functions can throw an exception.
tools/python/grilo-test-ui.py | 20 ++++++++++++++++----
1 files changed, 16 insertions(+), 4 deletions(-)
---
diff --git a/tools/python/grilo-test-ui.py b/tools/python/grilo-test-ui.py
index 157fb48..933fed5 100644
--- a/tools/python/grilo-test-ui.py
+++ b/tools/python/grilo-test-ui.py
@@ -77,20 +77,29 @@ class MainWindow(Gtk.Window):
flickr_config = Grl.Config.new('grl-flickr', None)
flickr_config.set_api_key(self.FLICKR_KEY)
flickr_config.set_api_secret(self.FLICKR_SECRET)
- registry.add_config(flickr_config)
+ try:
+ registry.add_config(flickr_config)
+ except:
+ print 'Cannot add Flickr config'
def _configure_vimeo(self):
registry = Grl.PluginRegistry.get_default()
vimeo_config = Grl.Config.new('grl-vimeo', None)
vimeo_config.set_api_key(self.VIMEO_KEY)
vimeo_config.set_api_secret(self.VIMEO_SECRET)
- registry.add_config(vimeo_config)
+ try:
+ registry.add_config(vimeo_config)
+ except:
+ print 'Cannot add Vimeo config'
def _configure_youtube(self):
registry = Grl.PluginRegistry.get_default()
youtube_config = Grl.Config.new('grl-youtube', None)
youtube_config.set_api_key(self.YOUTUBE_KEY)
- registry.add_config(youtube_config)
+ try:
+ registry.add_config(youtube_config)
+ except:
+ print 'Cannot add Youtube config'
def _lookup_browse_keys(self):
registry = Grl.PluginRegistry.get_default()
@@ -109,7 +118,10 @@ class MainWindow(Gtk.Window):
self._source_added_cb)
registry.connect('source-removed',
self._source_removed_cb)
- registry.load_all()
+ try:
+ registry.load_all()
+ except:
+ print 'Unable to load plugins'
def _setup_ui(self):
main_box = Gtk.HPaned()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]