[01:42:04] ** pythonhead has left IRC ("Client exiting") [04:02:44] [connected at Sat Aug 20 04:02:44 2005] [04:02:44] <> *** Looking up your hostname... [04:02:44] <> *** Checking ident [04:02:44] <> *** Found your hostname [04:03:18] <> *** No identd (auth) response [04:03:18] <> *** Your host is calvino.freenode.net[calvino.freenode.net/6667], running version hyperion-1.0rc5 [04:03:18] [I have joined #peak] [10:45:41] ** pythonhead has joined us [13:11:34] ** pje has joined us [13:11:50] pythonhead, FYI, you should read pkg_resources.txt in CVS to learn about the API [13:11:57] in particular, find_distributions(path_item) [13:12:03] and the stuff on the metadata API [13:12:30] Also, the Environment class is an index of installed packages by project name [13:12:32] Thanks, I'll look at that. I'm kind of stumped. I tried, find_byfile I think, but couldn't get the metadata [13:12:56] You don't want to use stuff that's not in the documentation like that. [13:13:10] Just create an Environment object [13:13:18] Ok, I'll grab the cvs and start reading [13:13:23] It's like a dictionary from project name to a list of installed Distribution objects [13:13:40] The Distribution objects have methods like get_metadata(name), has_metadata(name) etc. [13:13:58] Really, if you want all the eggs on sys.path, you can write something like: [13:14:03] env = Environment() [13:14:08] for project_name in env: [13:14:18] for dist in env[project_name]: [13:14:25] print dist [13:15:02] If you want to print the distribution's dependencies, print dist.requires() [13:15:29] Anyway, the docs for Environment, Distribution, and the metadata API should be the most relevant bits. [13:16:02] Great, thats going to help me get started, thanks [13:16:19] no problem; I just popped in 'cause I saw your question from yesterday. [13:16:24] Gotta run. [13:16:43] ** pje has left IRC ("Client exiting") [13:17:16] ** pje has joined us [13:17:21] Oh, forgot to mention... [13:17:34] If you want to know which distributions are *activated* on sys.path, you want the working_set [13:17:39] i.e.: [13:17:45] for dist in pkg_resources.working_set: [13:17:48] print dist [13:18:15] i.e., those are the ones that have been put on sys.path because of a .pth file or have been require()d to this point, etc. [13:18:23] Gotcha [13:18:30] WorkingSet objects track a set of activated distributions [13:18:41] Environment tracks *all* distributions in the directories on sys.path [13:18:55] (or whatever paths you give to the WorkingSet or Environment constructors, that is) [13:19:08] ** pje has left IRC (Client Quit) [16:01:41] ** erikrose has joined us [17:20:12] ** erikrose has left IRC ()