Few bugfixes.

This commit is contained in:
tonio
2010-06-14 17:13:33 +02:00
parent 29b76d5fa7
commit 99f5bd8510
3 changed files with 9 additions and 7 deletions
+2 -1
View File
@@ -288,7 +288,8 @@ ul.visible {
"text-align" : "center",
"height" : "25px",
"border" : "1px solid #333",
"background" : "white"})
"background" : "white",
"z-index" : 3})
.setStyles(item.getPosition())
.inject(document.body);
block.set("html", "Moving " + selectedRows.length + " messages");
+2 -2
View File
@@ -8,10 +8,10 @@ from django.template.loader import render_to_string
from django.utils.translation import ugettext as _
from mailng.lib import parameters
def exec_cmd(cmd):
def exec_cmd(cmd, **kwargs):
import subprocess
p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE)
p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, **kwargs)
output = p.communicate()[0]
return p.returncode, output
+5 -4
View File
@@ -1,4 +1,5 @@
import os
from django.conf import settings
from django import template
from mailng.lib import exec_cmd
@@ -6,13 +7,13 @@ register = template.Library()
@register.simple_tag
def get_version():
if os.path.isdir(".hg"):
if os.path.isdir("%s/.hg" % settings.MAILNG_DIR):
version = "dev-"
code, output = exec_cmd("hg id -i")
code, output = exec_cmd("hg id -i", cwd=settings.MAILNG_DIR)
version += output.rstrip()
return version
elif os.path.exists("VERSION"):
code, output = exec_cmd("cat VERSION")
elif os.path.exists("%s/VERSION" % settings.MAILNG_DIR):
code, output = exec_cmd("cat %s/VERSION" % settings.MAILNG_DIR)
return output.rstrip()
else:
return "Unknown"