summaryrefslogtreecommitdiff
path: root/helper.py
diff options
context:
space:
mode:
Diffstat (limited to 'helper.py')
-rw-r--r--helper.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/helper.py b/helper.py
index 866e93d..5c7425a 100644
--- a/helper.py
+++ b/helper.py
@@ -3,12 +3,13 @@ import os
import Image
import markdown
import cStringIO
-
+from collections import namedtuple
opj = os.path.join
# some nice imports
import itertools as it
+Version = namedtuple('Version', 'current last')
APPDIR = os.path.dirname(os.path.abspath(__file__))
def appdir (*args):
@@ -17,6 +18,10 @@ def appdir (*args):
def url (path):
return "\"%s\"" % web.url(path)
+def versions ():
+ with open(appdir("versions")) as f:
+ return Version._make(f.read().split())
+
def toJS (ls):
ls = ("'%s':'%s'" % x for x in ls)
return "{ %s }" % ", ".join(ls)