Esempio n. 1
0
    def on_download_cache(self, cache, sync=False):
        #
        self.gui.set_download_progress(0.5, "Downloading %s..." % cache.name)

        cd = GeocachingComCacheDownloader(self.downloader, self.settings['download_output_dir'], not self.settings['download_noimages'])
        cd.connect("download-error", self.on_download_error)
        cd.connect("already-downloading-error", self.on_already_downloading_error)
        if not sync:
            def same_thread(arg1, arg2):
                gobject.idle_add(self.on_download_cache_complete, arg1, arg2)
                return False
            cd.connect("finished-single", same_thread)
            t = Thread(target=cd.update_coordinate, args=[cache])
            t.daemon = False
            t.start()
            #t.join()
            return False
        else:
            full = cd.update_coordinate(cache)
            return full