application version checking against database

I

imageguy

We are trying to implement a system that checks the version of the
application against a version number stored in the database. We don't
want the app and the db don't become out of sync.

We have tried setting a __version__ variable in the top most module,
however, it seems that this is not accessible for the modules that are
subsequently imported. There are a several locations in the app where
we want to do the version check, but we would like to have one place
to set the version number, namely the top level module.

We have thought of creating a Version class and passing it around, but
aren't really keen on that idea.

Any suggestions/ideas would be helpful.


NOTE: the app is developed in wxPython.

g.
 
G

Gabriel Genellina

En Fri, 07 Sep 2007 10:12:09 -0300, Hamilton, William
You could add a Version module that contains the version number and any
functions related to the version checking, and import that into the
modules that do version checking.

Also, there is a version module already available from the standard
library:

from distutils.version import StrictVersion
__version__ = StrictVersion("1.3")
__version__ = '$Revision: 1.19 $'[11:-2]

The last line is for CVS.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top