[zypp-devel] Comments/ideas for libzypp-bindings-python
Moin moin! Just some observations/ideas and random stuff. RepoManager: * I miss iterators like knownRepos() and knownServices() returning the respective RepoInfo ** Reason: I can easily add repositories, but its hard to find the already known repos from RepoManager to query/refresh/whatever * If I use the nice feature addService("alias", URL("pathtorepofile")) i'm stuck refreshing the repos as >>> myrepomanager.refreshServices() fails with RuntimeError: Parse error * I've no chance to iterate and/or get repoinfos for handling. * i've an url and an alias, but no serviceinfo up to now, but TypeError: in method 'RepoManager_refreshService', argument 2 of type 'zypp::ServiceInfo const &' requires a ServiceInfo :/ * ok, getService(alias) works ... but syntax is bad imho... myrepomanager.refreshService(myrepomanager.getService("alias")) or ? If i can addService("alias", URL) why not refreshService("alias") ** btw refreshService fails here with "RuntimeError: Parse error" (same repos work done with repoinfo) best regards Jan-Simon -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
Jan-Simon Möller wrote:
Moin moin! Just some observations/ideas and random stuff.
RepoManager: * I miss iterators like knownRepos() and knownServices() returning the respective RepoInfo ** Reason: I can easily add repositories, but its hard to find the already known repos from RepoManager to query/refresh/whatever
knownRepositories() should be there, but is deprecated anyway. Use repoBegin(), repoEnd() iterators (plus repoSize(), repoEmpty()). I don't know how that is translated into python though. (BTW, we should name the methods at least reposBegin, not repoBegin).
* If I use the nice feature addService("alias", URL("pathtorepofile")) i'm stuck refreshing the repos as >>> myrepomanager.refreshServices() fails with RuntimeError: Parse error
Please, forget services for now (there are no working services out there to test them yet). Use just the repository staff in the RepoManager (addRepository, etc).
* I've no chance to iterate and/or get repoinfos for handling. * i've an url and an alias, but no serviceinfo up to now, but TypeError: in method 'RepoManager_refreshService', argument 2 of type 'zypp::ServiceInfo const &' requires a ServiceInfo :/
You can create one (or get an existing one, just like you did below)
* ok, getService(alias) works ... but syntax is bad imho... myrepomanager.refreshService(myrepomanager.getService("alias")) or ? If i can addService("alias", URL) why not refreshService("alias")
Yeah we can add such method...
** btw refreshService fails here with "RuntimeError: Parse error" (same repos work done with repoinfo)
Yes, that's because you don't have _service_, you have an ordinary repository, i guess. HTH jano -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
On Fri, Sep 05, Jano Kupec wrote:
Jan-Simon M?ler wrote:
Moin moin! Just some observations/ideas and random stuff.
RepoManager: * I miss iterators like knownRepos() and knownServices() returning the respective RepoInfo ** Reason: I can easily add repositories, but its hard to find the already known repos from RepoManager to query/refresh/whatever
knownRepositories() should be there, but is deprecated anyway. Use
No, someone disabled it in the bindings: %ignore zypp::RepoManager::knownRepositories; But i't convenient, so I'll add it if it works. repoManager = zypp.RepoManager() repos = repoManager.knownRepositories() for repo in repos: if not repo.enabled(): continue if not repoManager.isCached( repo ): repoManager.buildCache( repo ) repoManager.loadFromCache( repo ); -- cu, Michael Andres +------------------------------------------------------------------+ Key fingerprint = 2DFA 5D73 18B1 E7EF A862 27AC 3FB8 9E3A 27C6 B0E4 +------------------------------------------------------------------+ Michael Andres YaST Development ma@novell.com SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nuernberg) Maxfeldstrasse 5, D-90409 Nuernberg, Germany, ++49 (0)911 - 740 53-0 +------------------------------------------------------------------+ -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
Am Freitag 05 September 2008 14:41:16 schrieb Michael Andres:
But i't convenient, so I'll add it if it works.
repoManager = zypp.RepoManager() repos = repoManager.knownRepositories() for repo in repos: if not repo.enabled(): continue if not repoManager.isCached( repo ): repoManager.buildCache( repo ) repoManager.loadFromCache( repo );
Which makes thinks clear to me. Tnx for clarifying. Best regards Jan-Simon -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
participants (3)
-
Jan-Simon Möller
-
Jano Kupec
-
Michael Andres