diff options
author | Corentin Chary <corentin.chary@gmail.com> | 2012-07-24 08:33:19 +0200 |
---|---|---|
committer | Corentin Chary <corentin.chary@gmail.com> | 2012-07-24 08:33:19 +0200 |
commit | 46c2ea6f70758c4df56c1bc9cb28e0a0d3637c9d (patch) | |
tree | 224d474b5d85c02cd7f74e85d1832fb467ae7733 /bin | |
parent | djeuscan: smaller icons, change refresh icon (diff) | |
download | euscan-46c2ea6f70758c4df56c1bc9cb28e0a0d3637c9d.tar.gz euscan-46c2ea6f70758c4df56c1bc9cb28e0a0d3637c9d.tar.bz2 euscan-46c2ea6f70758c4df56c1bc9cb28e0a0d3637c9d.zip |
euscan: use python-git for __version__
Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/euscan | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -5,21 +5,26 @@ Distributed under the terms of the GNU General Public License v2 """ from __future__ import print_function - +import os # Meta __author__ = "Corentin Chary (iksaif)" __email__ = "corentin.chary@gmail.com" -__version__ = "git" __productname__ = "euscan" __description__ = "A tool to detect new upstream releases." +if os.path.exists(os.path.join(os.path.dirname(__file__), "..", ".git")): + import git + repo = git.Repo(os.path.join(os.path.dirname(__file__))) + __version__ = "git-%s" % repo.head.commit +else: + __version__ = "git" + # Imports import sys -import os import getopt from errno import EINTR, EINVAL from httplib import HTTPConnection |