separate merchant UI from main project
This commit is contained in:
22
lib/util.py
22
lib/util.py
@@ -703,25 +703,3 @@ class QueuePipe:
|
||||
self.send(request)
|
||||
|
||||
|
||||
def check_www_dir(rdir):
|
||||
import urllib, shutil, os
|
||||
if not os.path.exists(rdir):
|
||||
os.mkdir(rdir)
|
||||
index = os.path.join(rdir, 'index.html')
|
||||
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",
|
||||
"https://code.jquery.com/ui/1.10.3/jquery-ui.js",
|
||||
"https://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css"
|
||||
]
|
||||
for URL in files:
|
||||
path = urllib.parse.urlsplit(URL).path
|
||||
filename = os.path.basename(path)
|
||||
path = os.path.join(rdir, filename)
|
||||
if not os.path.exists(path):
|
||||
print_error("downloading ", URL)
|
||||
urllib.request.urlretrieve(URL, path)
|
||||
|
||||
Reference in New Issue
Block a user