app_dir=os.path.dirname(os.path.realpath(__file__))
stdout = subprocess.PIPE,
rev = pipe.communicate()[0]
# if this is not mercurial repository
# try to read revision from file
f = open(os.path.join(app_dir,"revision"))
app_version = app_version + "-" + rev.rstrip()