On Mon, Jan 19, 2009 at 6:13 PM, Jorge Vargas <[email protected]> wrote:
>
> On Mon, Jan 19, 2009 at 6:36 PM, will welch <[email protected]> 
> wrote:
>>
>> What's the blessed way for my application to get its version string
>> (eg, the 0.1.0dev_r159 portion of the egg name
>> application-0.1.0dev_r159-py2.4.egg)
>
> I'm not 100% of the question but you are looking for setup.py and
> setup.cfg egg_info section

To get the version in a program, you'd use a pkg_resources function.
Which one... hmm...
http://peak.telecommunity.com/DevCenter/PkgResources
How about...

version = pkg_resources.get_distribution("Pylons").version

If you want to compare one version to another, use .parsed_version |
parse_version() instead, which provide a normalized tuple.

-- 
Mike Orr <[email protected]>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to