remove unused function, code formating

This commit is contained in:
Mathieu PATUREL
2017-01-02 16:29:33 +11:00
parent 5a3b1a7f81
commit f52bf98470
4 changed files with 28 additions and 27 deletions

View File

@ -3,7 +3,6 @@
import os.path
from threading import Thread
import urllib.request
import base64
import sublime
from .functions import *
@ -12,18 +11,6 @@ TIMEOUT = 20 # seconds
SEPARATOR = '---%cache%--'
class InternalError(Exception): pass
def load_and_save_image(url, user_callback):
def callback(content):
content = to_base64(content=content)
with open(CACHE_FILE, 'a') as fp:
fp.write(url + SEPARATOR + content)
user_callback(content)
thread = ImageLoader(url, callback)
thread.start()
sublime.set_timeout_async(lambda: thread.join(), TIMEOUT * 1000)
def get_base64_saver(loading, url):
def callback(content):
loading[url] = to_base64(content=content)