kuuko pushed a commit to branch master.

http://git.enlightenment.org/apps/epour.git/commit/?id=7fb1efddbaac8994044482e5b7e681a5ba376c6b

commit 7fb1efddbaac8994044482e5b7e681a5ba376c6b
Author: Kai Huuhko <[email protected]>
Date:   Fri Jul 18 22:11:14 2014 +0300

    Check that torrent has metadata before attempting to display tooltip
---
 epour/gui/__init__.py | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/epour/gui/__init__.py b/epour/gui/__init__.py
index 9d4cce1..19aadd1 100644
--- a/epour/gui/__init__.py
+++ b/epour/gui/__init__.py
@@ -255,7 +255,12 @@ class MainInterface(object):
         if not h.is_valid():
             return
 
-        tt = TorrentTooltip(tooltip, h)
+        s = h.status(8)
+
+        if not s.has_metadata:
+            return
+
+        tt = TorrentTooltip(tooltip, h, s)
 
         return tt
 
@@ -584,12 +589,10 @@ class TorrentTooltip(Table):
         ("Number of peers", None, "num_peers"),
         )
 
-    def __init__(self, parent, h):
+    def __init__(self, parent, h, s):
 
         Table.__init__(self, parent, size_hint_weight=EXPAND_BOTH)
 
-        s = h.status(8)
-
         value_labels = []
 
         for i, (desc, conv, attr_name) in enumerate(self.items):

-- 


Reply via email to