tdon't rewrite index.html everytime - electrum - Electrum Bitcoin wallet HTML git clone https://git.parazyd.org/electrum DIR Log DIR Files DIR Refs DIR Submodules --- DIR commit 6ad3f476406e7d61de62b14eac5d76b4a33eaf92 DIR parent 679efe2a6683a52539950697b240af082ac9ede0 HTML Author: ThomasV <thomasv@electrum.org> Date: Tue, 15 Dec 2015 12:10:25 +0100 don't rewrite index.html everytime Diffstat: M lib/util.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) --- DIR diff --git a/lib/util.py b/lib/util.py t@@ -577,13 +577,14 @@ class StoreDict(dict): def check_www_dir(rdir): - # rewrite index.html every time import urllib, urlparse, shutil, os if not os.path.exists(rdir): os.mkdir(rdir) index = os.path.join(rdir, 'index.html') - src = os.path.join(os.path.dirname(__file__), 'www', 'index.html') - shutil.copy(src, index) + if not os.path.exists(index): + print_error("copying index.html") + src = os.path.join(os.path.dirname(__file__), 'www', 'index.html') + shutil.copy(src, index) files = [ "https://code.jquery.com/jquery-1.9.1.min.js", "https://raw.githubusercontent.com/davidshimjs/qrcodejs/master/qrcode.js",