mirror of
https://github.com/QingdaoU/OnlineJudge.git
synced 2025-11-04 14:49:58 +08:00
增加静态文件压缩脚本中的提示
This commit is contained in:
parent
6122cc1a32
commit
d5e12d6a23
@ -9,6 +9,12 @@ template_release_path = "template/release/"
|
|||||||
|
|
||||||
static_src_path = "static/src/"
|
static_src_path = "static/src/"
|
||||||
static_release_path = "static/release/"
|
static_release_path = "static/release/"
|
||||||
|
|
||||||
|
print "Begin to compress js"
|
||||||
|
if os.system("node static/src/js/r.js -o static/src/js/build.js"):
|
||||||
|
print "Failed to compress js, exit"
|
||||||
|
exit()
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# 删除模板的 release 文件夹
|
# 删除模板的 release 文件夹
|
||||||
shutil.rmtree(template_release_path)
|
shutil.rmtree(template_release_path)
|
||||||
@ -30,7 +36,7 @@ name_map = {}
|
|||||||
|
|
||||||
def process(match):
|
def process(match):
|
||||||
file_path = match.group(1).replace("/static/", "")
|
file_path = match.group(1).replace("/static/", "")
|
||||||
# print file_path, match.group(), match.group(1)
|
print "Processing: " + file_path
|
||||||
|
|
||||||
if not os.path.exists(static_release_path + file_path):
|
if not os.path.exists(static_release_path + file_path):
|
||||||
return match.group(0)
|
return match.group(0)
|
||||||
@ -59,3 +65,5 @@ for root, dirs, files in os.walk(template_release_path):
|
|||||||
f = open(html_path, "w")
|
f = open(html_path, "w")
|
||||||
f.write(css_replaced_html_content)
|
f.write(css_replaced_html_content)
|
||||||
f.close()
|
f.close()
|
||||||
|
|
||||||
|
print "Done"
|
||||||
Loading…
Reference in New Issue
Block a user