471,356 Members | 1,517 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,356 software developers and data experts.

application version checking against database

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.

Sep 7 '07 #1
1 1184
En Fri, 07 Sep 2007 10:12:09 -0300, Hamilton, William
<wh*****@entergy.comescribi�:
>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.

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.

--
Gabriel Genellina

Sep 8 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Petr PALAS | last post: by
reply views Thread by XIAOLAOHU | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.