Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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')
Ejemplo n.º 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)
Ejemplo n.º 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')