feed publishing tweak

changing feed publishing to report absolute instead of relative
timestamp
master
endorphant 2016-05-15 18:22:18 -04:00
parent fecb5b9907
commit 1ff8fe39cd
1 changed files with 3 additions and 4 deletions

View File

@ -567,15 +567,14 @@ def www_neighbors(users):
if core.valid(filename): if core.valid(filename):
lastfile = os.path.join("/home", user, ".ttbp", "entries", filename) lastfile = os.path.join("/home", user, ".ttbp", "entries", filename)
ago = "never"
if lastfile: if lastfile:
last = os.path.getctime(lastfile) last = os.path.getctime(lastfile)
since = time.time()-last timestamp = time.strftime("%Y-%m-%d at %H:%M", time.localtime(last))
ago = util.pretty_time(int(since)) + " ago"
else: else:
timestamp = ""
last = 0 last = 0
userList.append(["<a href=\""+url+"\">~"+user+"</a> ("+ago+")", last]) userList.append(["<a href=\""+url+"\">~"+user+"</a> "+timestamp, last])
# sort user by most recent entry # sort user by most recent entry
userList.sort(key = lambda userdata:userdata[1]) userList.sort(key = lambda userdata:userdata[1])