En Fri, 07 Sep 2007 10:12:09 -0300, Hamilton, William <[EMAIL PROTECTED]> escribi�:
>> 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 -- http://mail.python.org/mailman/listinfo/python-list