diff --git a/__init__.py b/__init__.py index 039188c1..756e46e8 100644 --- a/__init__.py +++ b/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -REVISION = '621' +REVISION = None ### import all the goodies and add some helper functions for easy CLI use @@ -11,7 +11,7 @@ from .Qt import QtGui #if QtGui.QApplication.instance() is None: #app = QtGui.QApplication([]) -import sys +import os, sys ## check python version if sys.version_info[0] < 2 or (sys.version_info[0] == 2 and sys.version_info[1] != 7): @@ -53,6 +53,13 @@ def systemInfo(): print "sys.version:", sys.version from .Qt import VERSION_INFO print "qt bindings:", VERSION_INFO + + global REVISION + if REVISION is None: ## this code was probably checked out from bzr; look up the last-revision file + lastRevFile = os.path.join(os.path.dirname(__file__), '.bzr', 'branch', 'last-revision') + if os.path.exists(lastRevFile): + REVISION = open(lastRevFile, 'r').read().strip() + print "pyqtgraph:", REVISION print "config:" import pprint