Пример #1
0
    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)
Пример #2
0
    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)
Пример #3
0
 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)
Пример #4
0
 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)
Пример #5
0
 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)
Пример #6
0
 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')
Пример #7
0
 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)
Пример #8
0
 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')