Browse Source

don't rewrite index.html everytime

283
ThomasV 9 years ago
parent
commit
6ad3f47640
  1. 7
      lib/util.py

7
lib/util.py

@ -577,13 +577,14 @@ class StoreDict(dict):
def check_www_dir(rdir): def check_www_dir(rdir):
# rewrite index.html every time
import urllib, urlparse, shutil, os import urllib, urlparse, shutil, os
if not os.path.exists(rdir): if not os.path.exists(rdir):
os.mkdir(rdir) os.mkdir(rdir)
index = os.path.join(rdir, 'index.html') index = os.path.join(rdir, 'index.html')
src = os.path.join(os.path.dirname(__file__), 'www', 'index.html') if not os.path.exists(index):
shutil.copy(src, index) print_error("copying index.html")
src = os.path.join(os.path.dirname(__file__), 'www', 'index.html')
shutil.copy(src, index)
files = [ files = [
"https://code.jquery.com/jquery-1.9.1.min.js", "https://code.jquery.com/jquery-1.9.1.min.js",
"https://raw.githubusercontent.com/davidshimjs/qrcodejs/master/qrcode.js", "https://raw.githubusercontent.com/davidshimjs/qrcodejs/master/qrcode.js",

Loading…
Cancel
Save