This commit is contained in:
tonio
2010-06-14 10:58:57 +02:00
parent e768046f9e
commit 96d64dae86
3 changed files with 20 additions and 1 deletions
View File
+18
View File
@@ -0,0 +1,18 @@
import os
from django import template
from mailng.lib import exec_cmd
register = template.Library()
@register.simple_tag
def get_version():
if os.path.isdir(".hg"):
version = "dev-"
code, output = exec_cmd("hg id -i")
version += output.rstrip()
return version
elif os.path.exists("VERSION"):
code, output = exec_cmd("cat VERSION")
return output.rstrip()
else:
return "Unknown"