~davidc3/onehundredscopes/opt-wikipedia

« back to all changes in this revision

Viewing changes to src/unity-lens-wikipedia

  • Committer: David Call√©
  • Date: 2012-06-14 15:52:34 UTC
  • Revision ID: davidc@framli.eu-20120614155234-x609v5m7rwie4hmb
/opt compliance

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
 
40
40
        self._lens.add_local_scope (self._scope);
41
41
        self._scope.connect("search-changed", self.on_search_changed)
 
42
        self._scope.connect ("activate-uri", self.on_activate_uri);
42
43
        svg_dir = "/usr/share/icons/unity-icon-theme/places/svg/"
43
44
        cats = []
44
45
        cats.append (Unity.Category.new ("Articles",
75
76
                                        #the below line can safely be uncommented when CardView layout learns to respect not-square (in this case circlular) icons
76
77
                    #image = "http://upload.wikimedia.org/wikipedia/commons/6/63/Wikipedia-logo.png"
77
78
                    #make the thumnails for the artciles without custom thumnails have a square icon, so CardView layout won't draw ugly black outline around those, will become obsolete when CardView layot learns to respect not-square (in this case circlular) icons
78
 
                    image = "/usr/share/unity/lenses/wikipedia/wiki_blank-"+str(random.randint(0,1))+".png"
 
79
                    image = "/opt/extras.ubuntu.com/unity-lens-wikipedia/media/wiki_blank-"+str(random.randint(0,1))+".png"
79
80
                    text = i.childNodes[0].firstChild.data
80
81
                    comment = i.childNodes[1].firstChild.data
81
82
                try:
104
105
        except (IOError, KeyError, urllib2.URLError, urllib2.HTTPError):
105
106
            print "Error : Unable to search Wikipedia"
106
107
            return []
107
 
        
 
108
 
 
109
    def on_activate_uri (self, scope, uri):
 
110
#        GLib.spawn_command_line_async('notify-send -i "%s" "%s" "%s"' % ('applications-graphics',notification_title, notification_text))
 
111
        print Unity.ActivationResponse(Unity.HandledType.HIDE_DASH, '')
 
112
#        return Unity.ActivationResponse(Unity.HandledType.HIDE_DASH,'')
 
113
 
108
114
if __name__ == "__main__":
109
115
    session_bus_connection = Gio.bus_get_sync (Gio.BusType.SESSION, None)
110
116
    session_bus = Gio.DBusProxy.new_sync (session_bus_connection, 0, None,