def tags_cb(self, tags): self.snippet['tags'] = tags # Open the language prompt once languages have downloaded handle_thread(self.threads['get_languages'], 'Downloading language list', cb=self.language_prompt)
def result_selection_cb(self, index): if index >= 0: selection = self.search_results[index] t = Worker(lambda: self.download(selection['id'])) t.start() self.threads['download'] = t handle_thread(t, 'Downloading snippet (%s)' % (selection['title'],), self.download_cb)
def result_selection_cb(self, index): if index >= 0: selection = self.search_results[index] t = Worker(lambda: self.download(selection['id'])) t.start() self.threads['download'] = t handle_thread(t, 'Downloading snippet (%s)' % (selection['title'], ), self.download_cb)
def search(self, keywords): t = Worker(lambda: self._search(keywords)) t.start() self.threads['search'] = t handle_thread(t, 'Searching Snipplr for: ' + keywords, self.search_cb)
def language_cb(self, index): if index >= 0: self.snippet['language'] = self.language_list[index] t = threading.Thread(target=self.upload_snippet) t.start() handle_thread(t, 'Uploading snippet')