Ejemplo n.º 1
0
 def on_videoSearchMoreButton_clicked(self):
     self.videoSearchMoreButton.setEnabled(False)
     feed, params = "videos", [("q", self.videoSearchMoreQuery),
                               ("max-results", "50"),
                               ("start-index", str(self.videoSearchMorePage * 50 + 1))]
     data = gdata(feed, params)
     for i in self.makeListWidgetItemListFromGDATA(data):
         self.videoSearchResults.addItem(i)
     self.videoSearchMorePage += 1
     self.videoSearchMoreButton.setEnabled(True)
Ejemplo n.º 2
0
 def on_videoFeedButton_clicked(self):
     self.videoFeedResults.clear()
     parameters = list()
     feed = self.videoFeedInput.text()
     if "?" in feed:
         feed, s = feed.split("?", 1)
         d = sdict_parser(s)
         parameters.extend(d.items())
     try:
         lst = self.makeListWidgetItemListFromGDATA(gdata(feed, parameters))
     except auth.yauth.request.HTTPError as e:
         QtGui.QMessageBox.critical(self, "API Error", e.fp.read().decode("utf8"))
     for i in lst:
         self.videoFeedResults.addItem(i)