Mailinglist Archive: zypp-devel (149 mails)
| < Previous | Next > |
[zypp-devel] python: ResPool object is unsubscriptable
- From: "Nikolay Derkach" <nderkach@xxxxxxxxx>
- Date: Sun, 7 Sep 2008 16:15:58 +0400
- Message-id: <f276b80f0809070515j54140ecav81df4643439d442a@xxxxxxxxxxxxxx>
Hi,
I would be nice if ResPool objects would be subscriptable
(dictionaries). For example it'd be very convenient to have an access
to pool items like this:
Z = zypp.ZYppFactory_instance().getZYpp()
...
p = Z.pool()
print p[package_name].isInstalled()
where package_name is a key name (pool item name).
Right now the only way I could find to do this is:
for item in Z.pool():
if item.name() == pkg_name:
print item.status().isInstalled()
which makes code a bit bloated.
--
Regards, Nikolay Derkach
--
To unsubscribe, e-mail: zypp-devel+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-devel+help@xxxxxxxxxxxx
I would be nice if ResPool objects would be subscriptable
(dictionaries). For example it'd be very convenient to have an access
to pool items like this:
Z = zypp.ZYppFactory_instance().getZYpp()
...
p = Z.pool()
print p[package_name].isInstalled()
where package_name is a key name (pool item name).
Right now the only way I could find to do this is:
for item in Z.pool():
if item.name() == pkg_name:
print item.status().isInstalled()
which makes code a bit bloated.
--
Regards, Nikolay Derkach
--
To unsubscribe, e-mail: zypp-devel+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-devel+help@xxxxxxxxxxxx
| < Previous | Next > |