[Yum-devel] [PATCH][RFC] Make object show some info

seth vidal skvidal at fedoraproject.org
Sun Feb 3 17:48:02 UTC 2008


On Sun, 2008-02-03 at 11:43 -0500, James Antill wrote:
> On Sun, 2008-02-03 at 14:19 +0100, Tim Lauridsen wrote:
> > Today if you run the attached test script, you will get this output.
> > 
> > [tim at naboo yum]$ sudo python ~/yum-repr-test.py
> > [<yum.packages.YumInstalledPackage object at 0xb73c56c>]
> > [<yum.sqlitesack.YumAvailablePackageSqlite object at 0xb73dbcc>]
> > 
> > after adding the attached patch you will get this output.
> > 
> > [tim at naboo yum]$ cp ~/yum-repr-test.py .
> > [tim at naboo yum]$ sudo python ./yum-repr-test.py
> > [<Installed Package : yumex-2.0.3-2.fc8.noarch >]
> > [<Available Package : yumex-2.0.3-2.fc8.noarch (updates) >]
> > 
> > much more informative, very useful wen debugging yum and running in the 
> > interactive python console.
> > 
> > Anybody have any objections to adding this patch.
> 
>  Not an objection as such, but could you add id() as well, just so we
> can guarantee uniqueness.

be careful with id. Especially don't use pkgid. If you're going to use
anything use a hash of repoid + pkgid + something else.

-sv





More information about the Yum-devel mailing list