Skip to content

Commit 80bba96

Browse files
feaet : update.py script added
1 parent 3899e4f commit 80bba96

File tree

3 files changed

+21
-4
lines changed

3 files changed

+21
-4
lines changed

cache.appcache

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
CACHE MANIFEST
22

33
# Adds the ability to play the game offline.
4+
# Updated: 2017-10-18 23:58:47.587
45

56
# Main page
67
index.html

sw.js

-4
This file was deleted.

update.py

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# -*- coding: utf-8 -*-
2+
import datetime
3+
import re
4+
def format_time():
5+
t = datetime.datetime.now()
6+
s = t.strftime('%Y-%m-%d %H:%M:%S.%f')
7+
tail = s[-7:]
8+
f = round(float(tail), 3)
9+
temp = "%.3f" % f
10+
return "# Updated: "+"%s%s" % (s[:-7], temp[1:])
11+
12+
if __name__=="__main__":
13+
file=open("cache.appcache","r")
14+
data=file.read()
15+
file.close()
16+
data=re.sub(r'# Updated:.*',format_time(),data)
17+
new_file=open("cache.appcache","w")
18+
new_file.write(data)
19+
new_file.close()
20+

0 commit comments

Comments
 (0)