[pitivi] mainwindow: Get rid of generic try/except when previewing



commit e81faacbe9f92db53d68bccb1f32787856cb9428
Author: Alexandru Băluț <alexandru balut gmail com>
Date:   Sat Jan 18 21:36:05 2014 +0100

    mainwindow: Get rid of generic try/except when previewing

 pitivi/mainwindow.py |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/pitivi/mainwindow.py b/pitivi/mainwindow.py
index 10029f9..c20acd1 100644
--- a/pitivi/mainwindow.py
+++ b/pitivi/mainwindow.py
@@ -593,7 +593,7 @@ class PitiviMainWindow(Gtk.Window, Loggable):
         if asset.is_image():
             os.system('xdg-open "%s"' % path_from_uri(asset.get_id()))
         else:
-            self._viewUri(asset.get_id())
+            self._previewAsset(asset.get_id())
 
     def _projectChangedCb(self, unused_project):
         self.main_actions.get_action("SaveProject").set_sensitive(True)
@@ -1251,7 +1251,7 @@ class PitiviMainWindow(Gtk.Window, Loggable):
     def _leavePreviewCb(self, window, unused):
         window.destroy()
 
-    def _viewUri(self, uri):
+    def _previewAsset(self, uri):
         """ Preview a media file from the media library """
         preview_window = Gtk.Window()
         preview_window.set_title(_("Preview - click outside to close"))
@@ -1270,8 +1270,9 @@ class PitiviMainWindow(Gtk.Window, Loggable):
         if video_streams:
             # For videos and images, automatically resize the window
             # Try to keep it 1:1 if it can fit within 85% of the parent window
-            img_width = video_streams[0].get_width()
-            img_height = video_streams[0].get_height()
+            video = video_streams[0]
+            img_width = video.get_width()
+            img_height = video.get_height()
             controls_height = previewer.bbox.size_request().height
             mainwindow_width, mainwindow_height = self.get_size()
             max_width = 0.85 * mainwindow_width


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