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"
+2 -1
View File
@@ -1,4 +1,5 @@
{% load i18n %}
{% load libextras %}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
@@ -21,7 +22,7 @@
{% if error %}
<div class="error"><p>{{ error }}</p></div>
{% endif %}
<h2>2010 - Version 0.7-dev</h2>
<h2>{% now "Y" %} - Version {% get_version %}</h2>
</div>
<div id="test">
<h3>{% trans "Welcome" %}</h3>