function to find the modification date of the project
James Mills
prologic at shortcircuit.net.au
Mon Jan 19 17:39:51 EST 2009
On Tue, Jan 20, 2009 at 7:44 AM, Joe Strout <joe at strout.net> wrote:
> This isn't a question, but something I thought others may find useful (and
> if somebody can spot any errors with it, I'll be grateful).
>
> We had a case recently where the client was running an older version of our
> app, and didn't realize it. In other languages I've avoided this by
> displaying the compile date in the About box, but of course Python doesn't
> really have a meaningful compile date. So, instead we're now displaying the
> latest modification date of any .py file in the project. Here's the
> function that finds that:
You know you could just store a __version__
attribute in your main library (__init__.py). :)
Normally in my project, this version string
is stored in __version__.py in my library and
fetched in by my library's __init__.py and setup.py
for distribution. Works great :)
cheers
James
More information about the Python-list
mailing list