aboutsummaryrefslogtreecommitdiffstats
path: root/pasteme.py
diff options
context:
space:
mode:
Diffstat (limited to 'pasteme.py')
-rwxr-xr-xpasteme.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/pasteme.py b/pasteme.py
index f054beb..913b83e 100755
--- a/pasteme.py
+++ b/pasteme.py
@@ -1,5 +1,6 @@
#!/usr/bin/python3
+import time
import bottle
import pygments
import pygments.formatters
@@ -58,7 +59,11 @@ def route_paste_get(pid, pformat='colored'):
except pygments.util.ClassNotFound:
lexer = pygments.lexers.special.TextLexer()
content = pygments.highlight(content, lexer, pygment_formater)
- return bottle.template('paste', content=content, pid=pid)
+ timeleft = path.lstat()[9] + config.timeout * 24 * 3600
+ return bottle.template('paste',
+ content=content,
+ timeleft=time.ctime(timeleft),
+ pid=pid)
bottle.response.content_type = 'text/plain; charset=UTF8' # HTTP header
return content