1. Joel Mohler
  2. PyHacc

Commits

Joel Mohler  committed 0be8bbd

versions & version elucidation in the about box

  • Participants
  • Parent commits bc24415
  • Branches default

Comments (0)

Files changed (4)

File lib/PyHaccLib.py

View file
 from sqlalchemy.orm import sessionmaker
 import sqlalchemy.pool
 
-pyhacc_version = '0.7'
-
 def SessionSource(conn, create_level=0, demo_info = None):
     if conn == 'sqlite://':
         engine = create_engine(conn, poolclass=sqlalchemy.pool.StaticPool, connect_args={'check_same_thread':False})

File lib/PyHaccMainWindow.py

View file
 from PyHaccLib import *
 from Transactions import *
 from BalanceDock import *
-            
+
+def module_ver(name):
+    import importlib
+    try:
+        if name == "Python":
+            import sys
+            v = sys.version.split(' ')[0]
+        elif name == "PyQt4":
+            x = importlib.import_module("PyQt4.QtCore")
+            v = x.PYQT_VERSION_STR
+        else:
+            x = importlib.import_module(name)
+            v = x.__version__
+    except:
+        v = "unknown version"
+    return "{0} ({1})".format(name, v)
+
 class WindowChooser(QtCore.QObject):
     def __init__(self,mainWindow,child):
         QtCore.QObject.__init__(self)
 
     @helpCommands.command("&About", statusTip="Show the application's About box")
     def about(self):
+        vers = [module_ver(m) for m in ["Python", "pyhacc", "sqlalchemy", "qtalchemy", "fuzzyparsers", "geraldo", QtCore.__name__.split('.')[0]]]
+        vers = "<br />".join(vers)
         QtGui.QMessageBox.about(self, self.tr("About Menu"),
                 self.tr("""This is PyHacc!<br />
-Version {ver}<br />
 <a href="http://bitbucket.org/jbmohler/pyhacc">Bit Bucket Page</a>
 
-<p>Running on {qtbindings}.</p>
+<p>Library Versions:  <br />{vers}</p>
 
-<p>Copyright 2010-2011 Joel B. Mohler</p>""".format(ver=pyhacc_version, qtbindings=QtCore.__name__.split('.')[0])))
+<p>Copyright 2010-2012 Joel B. Mohler</p>""".format(vers=vers)))
 
     @helpCommands.command("About &Qt", statusTip="Show the Qt library's About box")
     def aboutQt(self):

File lib/__init__.py

View file
 from PyHaccLib import SessionSource, MemorySource, init_session_maker, gui_app
 from PyHaccSchema import *
 import reports
+
+__version_info__ = ['0', '7']
+__version__ = '.'.join(__version_info__)

File setup.py

View file
     return open(os.path.join(os.path.dirname(__file__), fname)).read()
 
 setup(name='PyHacc',
-    version='0.7', # also update in lib/PyHaccLib.py
+    version='0.7', # also update in lib/__init__.py
     description='pyhacc personal accounting',
     author='Joel B. Mohler',
     author_email='joel@kiwistrawberry.us',