summaryrefslogtreecommitdiff
path: root/swig
diff options
context:
space:
mode:
authorKlaus Kämpf <kkaempf@suse.de>2010-12-06 19:57:18 +0100
committerKlaus Kämpf <kkaempf@suse.de>2010-12-06 19:57:18 +0100
commit0df3e89c689074ccf4e82597b9d584da061763d4 (patch)
tree6e514ce37734e9e20ec60c4d1af0ea192513efe4 /swig
parent1523695ac4370c085f89f65e329c83f51680262d (diff)
downloadlibzypp-bindings-0df3e89c689074ccf4e82597b9d584da061763d4.tar.gz
libzypp-bindings-0df3e89c689074ccf4e82597b9d584da061763d4.tar.bz2
libzypp-bindings-0df3e89c689074ccf4e82597b9d584da061763d4.zip
Export Package/Resolvable attributes
Diffstat (limited to 'swig')
-rw-r--r--swig/python/tests/CMakeLists.txt1
-rw-r--r--swig/python/tests/installed_path.py27
-rw-r--r--swig/zypp.i4
3 files changed, 30 insertions, 2 deletions
diff --git a/swig/python/tests/CMakeLists.txt b/swig/python/tests/CMakeLists.txt
index e35d3ac..43b8d1b 100644
--- a/swig/python/tests/CMakeLists.txt
+++ b/swig/python/tests/CMakeLists.txt
@@ -8,3 +8,4 @@ ADD_TEST(bindings_python_loading python ${CMAKE_CURRENT_SOURCE_DIR}/loading.
ADD_TEST(bindings_python_repoinfo python ${CMAKE_CURRENT_SOURCE_DIR}/repoinfo.py)
ADD_TEST(bindings_python_commit_callbacks python ${CMAKE_CURRENT_SOURCE_DIR}/commit_callbacks.py)
ADD_TEST(bindings_python_problems python ${CMAKE_CURRENT_SOURCE_DIR}/problems.py)
+ADD_TEST(bindings_python_installed_path python ${CMAKE_CURRENT_SOURCE_DIR}/installed_path.py)
diff --git a/swig/python/tests/installed_path.py b/swig/python/tests/installed_path.py
new file mode 100644
index 0000000..f8c77f8
--- /dev/null
+++ b/swig/python/tests/installed_path.py
@@ -0,0 +1,27 @@
+import unittest
+
+import os
+cwd = os.path.abspath(os.path.dirname(__file__))
+
+import sys
+sys.path.insert(0, cwd + "/../../../build/swig/python")
+
+class TestSequenceFunctions(unittest.TestCase):
+
+ def testpath(self):
+ import zypp
+ Z = zypp.ZYppFactory.instance().getZYpp()
+ assert Z
+ Z.initializeTarget( zypp.Pathname("/") )
+ Z.target().load()
+ installed_pkgs = Z.pool()
+ for item in installed_pkgs:
+ if not zypp.isKindPattern(item):
+ print "Repopath %s" % item.repoInfo().packagesPath()
+ item = zypp.asKindPackage(item)
+ print "Location filename %s" % item.location().filename()
+ print "%s.%s %s:%d" % (item.name(), item.arch(), item.edition(), item.installSize())
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/swig/zypp.i b/swig/zypp.i
index 3bb867a..08d573b 100644
--- a/swig/zypp.i
+++ b/swig/zypp.i
@@ -221,6 +221,8 @@ namespace zypp {
%include "Capability.i"
%include "Capabilities.i"
%include "CapMatch.i"
+%include "OnMediaLocation.i"
+%include "Resolvable.i"
%include "RepoType.i"
%include "RepoInfo.i"
%include "ServiceInfo.i"
@@ -261,9 +263,7 @@ namespace zypp {
%include "ZYppFactory.i"
#endif
-/* These include files are already cleaned up from C++ cruft */
%include "Arch.i"
-%include "Resolvable.i"
%include "Callbacks.i"
//