mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-20 06:08:35 +02:00
Ticket #61.
This commit is contained in:
@@ -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"
|
||||
Reference in New Issue
Block a user