diff options
author | Arvin Schnell <aschnell@suse.de> | 2007-07-25 13:56:27 +0000 |
---|---|---|
committer | Arvin Schnell <aschnell@suse.de> | 2007-07-25 13:56:27 +0000 |
commit | d6ac3d222488959fd044f0433bbe82b4ef95e250 (patch) | |
tree | a43337e303c958bc824b63970b651664a28ce567 /examples | |
parent | 0f35ecf49cb8723a24b11435f7717f8b0d8821e5 (diff) | |
download | libzypp-bindings-d6ac3d222488959fd044f0433bbe82b4ef95e250.tar.gz libzypp-bindings-d6ac3d222488959fd044f0433bbe82b4ef95e250.tar.bz2 libzypp-bindings-d6ac3d222488959fd044f0433bbe82b4ef95e250.zip |
- some work on capabilities
Diffstat (limited to 'examples')
-rw-r--r-- | examples/python/list_target_resolvables.py | 18 | ||||
-rw-r--r-- | examples/ruby/list_target_resolvables.rb | 19 |
2 files changed, 31 insertions, 6 deletions
diff --git a/examples/python/list_target_resolvables.py b/examples/python/list_target_resolvables.py index 160ff7f..f21bd57 100644 --- a/examples/python/list_target_resolvables.py +++ b/examples/python/list_target_resolvables.py @@ -1,11 +1,25 @@ -from zypp import ZYppFactory +from zypp import ZYppFactory, Dep z = ZYppFactory.instance().getZYpp() +print z -z.initializeTarget ("/") +z.initializeTarget("/") r = z.target().resolvables() +print r # TODO: display resolvables +p = r.haha() +print p +print p.name() +print p.summary() + +d = p.dep(Dep.PROVIDES) +print d + +x = d.haha() +print x +print x.asString() + diff --git a/examples/ruby/list_target_resolvables.rb b/examples/ruby/list_target_resolvables.rb index a4e40ea..da88a0d 100644 --- a/examples/ruby/list_target_resolvables.rb +++ b/examples/ruby/list_target_resolvables.rb @@ -12,11 +12,22 @@ r = z.target.resolvables # puts r.class r.each do | p | + # puts p.class puts "#{p.kind_to_s} #{p.name} #{p.edition.to_s} #{p.arch.to_s}" - puts " #{p.summary}" - puts " #{p.size}" - puts " #{p.vendor}" - puts " #{p.buildtime}" + puts " Summary: #{p.summary}" + puts " Size: #{p.size}" + puts " Vendor: #{p.vendor}" + puts " Buildtime: #{p.buildtime}" + + d = p.dep(Dep.PROVIDES) + # puts d.class + d.each do | x | + # puts x.class + puts " Provides: #{x.to_s}" + end + + puts + end |