[pitivi] ui: Do not crash when trying to sort a DiscovererInfo sublcass we do not support



commit ef0e4cc641bbfc47d7a086940f6a9789eed44922
Author: Thibault Saunier <thibault saunier collabora com>
Date:   Fri Jan 11 16:27:08 2013 -0300

    ui: Do not crash when trying to sort a DiscovererInfo sublcass we do not support

 pitivi/utils/ui.py |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/pitivi/utils/ui.py b/pitivi/utils/ui.py
index c8b2bd5..9d82368 100644
--- a/pitivi/utils/ui.py
+++ b/pitivi/utils/ui.py
@@ -174,7 +174,10 @@ def beautify_info(info):
     }
 
     def stream_sort_key(stream):
-        return ranks[type(stream)]
+        try:
+            return ranks[type(stream)]
+        except KeyError:
+            return len(ranks)
 
     info.get_stream_list().sort(key=stream_sort_key)
     nice_streams_txts = []



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]