Mailinglist Archive: opensuse-commit (2092 mails)

< Previous Next >
commit libzypp-bindings
  • From: root@xxxxxxxxxxxxxxx (h_root)
  • Date: Thu, 30 Aug 2007 23:09:29 +0200
  • Message-id: <20070830210930.41668678182@xxxxxxxxxxxxxxx>

Hello community,

here is the log from the commit of package libzypp-bindings
checked in at Thu Aug 30 23:09:29 CEST 2007.

--------
--- libzypp-bindings/libzypp-bindings.changes   2007-08-29 00:01:22.000000000 +0200
+++ /mounts/work_src_done/STABLE/libzypp-bindings/libzypp-bindings.changes      2007-08-30 17:35:48.205497000 +0200
@@ -1,0 +2,5 @@
+Thu Aug 30 16:31:16 CEST 2007 - aschnell@xxxxxxx
+
+- some work on python bindings
+
+-------------------------------------------------------------------

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ libzypp-bindings.spec ++++++
--- /var/tmp/diff_new_pack.d17841/_old  2007-08-30 23:09:15.000000000 +0200
+++ /var/tmp/diff_new_pack.d17841/_new  2007-08-30 23:09:15.000000000 +0200
@@ -11,7 +11,7 @@
 
 Name:           libzypp-bindings
 Version:        0.4.2
-Release:        2
+Release:        3
 License:        GPL v2 or later
 Summary:        Bindings for libzypp
 Group:          Development/Sources
@@ -96,6 +96,8 @@
 %{_libdir}/python2.5/site-packages/zypp.py
 
 %changelog
+* Thu Aug 30 2007 - aschnell@xxxxxxx
+- some work on python bindings
 * Tue Aug 28 2007 - aschnell@xxxxxxx
 - added KeyRing and PublicKey classes
 * Thu Aug 23 2007 - aschnell@xxxxxxx

++++++ libzypp-bindings-0.4.2.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-bindings-0.4.2/examples/python/keyring.py new/libzypp-bindings-0.4.2/examples/python/keyring.py
--- old/libzypp-bindings-0.4.2/examples/python/keyring.py       1970-01-01 01:00:00.000000000 +0100
+++ new/libzypp-bindings-0.4.2/examples/python/keyring.py       2007-08-30 17:36:55.000000000 +0200
@@ -0,0 +1,29 @@
+#!/usr/bin/python
+
+from zypp import ZYppFactory, Pathname, KeyRing, PublicKey
+
+
+keyring = ZYppFactory.instance().getZYpp().keyRing()
+
+path = Pathname("/suse/aschnell/tmp/repodata/repomd.xml.key")
+print path
+
+publickey = PublicKey(path)
+print publickey
+
+id = publickey.id()
+
+print "is key known/trusted %s %s" % (keyring.isKeyKnown(id), keyring.isKeyTrusted(id))
+
+keyring.importKey(publickey, True)
+
+print "is key known/trusted %s %s" % (keyring.isKeyKnown(id), keyring.isKeyTrusted(id))
+
+print "list of known keys:"
+for key in keyring.publicKeys():
+    print key
+
+print "list of trusted keys:"
+for key in keyring.trustedPublicKeys():
+    print key
+
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-bindings-0.4.2/examples/python/list_target_resolvables.py new/libzypp-bindings-0.4.2/examples/python/list_target_resolvables.py
--- old/libzypp-bindings-0.4.2/examples/python/list_target_resolvables.py       2007-08-29 00:01:05.000000000 +0200
+++ new/libzypp-bindings-0.4.2/examples/python/list_target_resolvables.py       2007-08-30 17:36:55.000000000 +0200
@@ -22,5 +22,4 @@
 
 x = d.haha()
 print x
-print x.asString()
 
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-bindings-0.4.2/examples/ruby/keyring.rb new/libzypp-bindings-0.4.2/examples/ruby/keyring.rb
--- old/libzypp-bindings-0.4.2/examples/ruby/keyring.rb 2007-08-29 00:01:05.000000000 +0200
+++ new/libzypp-bindings-0.4.2/examples/ruby/keyring.rb 2007-08-30 17:36:55.000000000 +0200
@@ -14,11 +14,19 @@
 
 id = publickey.id()
 
-puts "known #{keyring.is_key_known(id)}"
-puts "trusted #{keyring.is_key_trusted(id)}"
+puts "is key known/trusted #{keyring.is_key_known(id)} #{keyring.is_key_trusted(id)}"
 
 keyring.import_key(publickey, true)
 
-puts "known #{keyring.is_key_known(id)}"
-puts "trusted #{keyring.is_key_trusted(id)}"
+puts "is key known/trusted #{keyring.is_key_known(id)} #{keyring.is_key_trusted(id)}"
+
+puts "list of known keys:"
+keyring.public_keys.each do |key|
+    puts key
+end
+
+puts "list of trusted keys:"
+keyring.trusted_public_keys.each do |key|
+    puts key
+end
 
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-bindings-0.4.2/swig/Arch.i new/libzypp-bindings-0.4.2/swig/Arch.i
--- old/libzypp-bindings-0.4.2/swig/Arch.i      2007-08-29 00:01:05.000000000 +0200
+++ new/libzypp-bindings-0.4.2/swig/Arch.i      2007-08-30 17:36:55.000000000 +0200
@@ -3,8 +3,8 @@
 
 %ignore Arch::compare(const Arch &, const Arch &);
 
-#ifdef SWIGRUBY
-%alias Arch::asString "to_s";
+#if defined(SWIGPYTHON) || defined(SWIGRUBY)
+%rename Arch::asString "__str__";
 #endif
 
 class Arch
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-bindings-0.4.2/swig/Capability.i new/libzypp-bindings-0.4.2/swig/Capability.i
--- old/libzypp-bindings-0.4.2/swig/Capability.i        2007-08-29 00:01:05.000000000 +0200
+++ new/libzypp-bindings-0.4.2/swig/Capability.i        2007-08-30 17:36:55.000000000 +0200
@@ -1,6 +1,6 @@
 
-#ifdef SWIGRUBY
-%alias Capability::asString "to_s";
+#if defined(SWIGPYTHON) || defined(SWIGRUBY)
+%rename Capability::asString "__str__";
 #endif
 
 class Capability
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-bindings-0.4.2/swig/Edition.i new/libzypp-bindings-0.4.2/swig/Edition.i
--- old/libzypp-bindings-0.4.2/swig/Edition.i   2007-08-29 00:01:05.000000000 +0200
+++ new/libzypp-bindings-0.4.2/swig/Edition.i   2007-08-30 17:36:55.000000000 +0200
@@ -1,6 +1,6 @@
 
-#ifdef SWIGRUBY
-%alias Edition::asString "to_s";
+#if defined(SWIGPYTHON) || defined(SWIGRUBY)
+%rename Edition::asString "__str__";
 #endif
 
 class Edition
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-bindings-0.4.2/swig/KeyRing.i new/libzypp-bindings-0.4.2/swig/KeyRing.i
--- old/libzypp-bindings-0.4.2/swig/KeyRing.i   2007-08-29 00:01:05.000000000 +0200
+++ new/libzypp-bindings-0.4.2/swig/KeyRing.i   2007-08-30 17:36:55.000000000 +0200
@@ -16,7 +16,12 @@
 
     void deleteKey(const std::string& id, bool trusted = false);
 
+    std::list<PublicKey> publicKeys();
+    std::list<PublicKey> trustedPublicKeys();
+
 };
 
 %template(KeyRing_Ptr) intrusive_ptr<KeyRing>;
 
+%template(list_PublicKey) std::list<PublicKey>;
+
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-bindings-0.4.2/swig/Pathname.i new/libzypp-bindings-0.4.2/swig/Pathname.i
--- old/libzypp-bindings-0.4.2/swig/Pathname.i  2007-08-29 00:01:05.000000000 +0200
+++ new/libzypp-bindings-0.4.2/swig/Pathname.i  2007-08-30 17:36:55.000000000 +0200
@@ -1,6 +1,6 @@
 
-#ifdef SWIGRUBY
-%alias Pathname::c_str "to_s";
+#if defined(SWIGPYTHON) || defined(SWIGRUBY)
+%rename Pathname::asString "__str__";
 #endif
 
 class Pathname
@@ -11,7 +11,7 @@
     Pathname(const std::string&);
     Pathname(const char*);
 
-    const char* c_str() const;
+    const std::string & asString() const;
 
     bool empty() const;
     bool absolute() const;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-bindings-0.4.2/swig/PublicKey.i new/libzypp-bindings-0.4.2/swig/PublicKey.i
--- old/libzypp-bindings-0.4.2/swig/PublicKey.i 2007-08-29 00:01:05.000000000 +0200
+++ new/libzypp-bindings-0.4.2/swig/PublicKey.i 2007-08-30 17:36:55.000000000 +0200
@@ -1,6 +1,6 @@
 
-#ifdef SWIGRUBY
-%alias PublicKey::asString "to_s";
+#if defined(SWIGPYTHON) || defined(SWIGRUBY)
+%rename PublicKey::asString "__str__";
 #endif
 
 class PublicKey
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-bindings-0.4.2/swig/python/CMakeLists.txt new/libzypp-bindings-0.4.2/swig/python/CMakeLists.txt
--- old/libzypp-bindings-0.4.2/swig/python/CMakeLists.txt       2007-08-29 00:01:05.000000000 +0200
+++ new/libzypp-bindings-0.4.2/swig/python/CMakeLists.txt       2007-08-30 17:36:55.000000000 +0200
@@ -1,15 +1,15 @@
 
 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-strict-aliasing")
 
+FIND_PACKAGE(PythonInterp REQUIRED)
 FIND_PACKAGE(PythonLibs REQUIRED)
-MESSAGE( STATUS "Python include path: ${PYTHON_INCLUDE_PATH}" )
 
-IF(DEFINED LIB)
-  SET(PYTHON_LIB_PATH "/usr/${LIB}/python2.5/site-packages/")
-ELSE(DEFINED LIB)
-  SET(PYTHON_LIB_PATH "/usr/lib/python2.5/site-packages/")
-ENDIF(DEFINED LIB)
+EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "from distutils import sysconfig; print sysconfig.get_python_lib()" OUTPUT_VARIABLE PYTHON_LIB_PATH)
+STRING(REPLACE "\n" "" PYTHON_LIB_PATH "${PYTHON_LIB_PATH}")
+
+MESSAGE(STATUS "Python executable: ${PYTHON_EXECUTABLE}")
 MESSAGE(STATUS "Python lib path: ${PYTHON_LIB_PATH}")
+MESSAGE(STATUS "Python include path: ${PYTHON_INCLUDE_PATH}")
 
 SET( SWIG_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/zypp_wrap.cxx" )
 SET( SWIG_INPUT "${CMAKE_CURRENT_SOURCE_DIR}/zypp.i" )
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-bindings-0.4.2/swig/RepoType.i new/libzypp-bindings-0.4.2/swig/RepoType.i
--- old/libzypp-bindings-0.4.2/swig/RepoType.i  2007-08-29 00:01:05.000000000 +0200
+++ new/libzypp-bindings-0.4.2/swig/RepoType.i  2007-08-30 17:36:55.000000000 +0200
@@ -1,6 +1,6 @@
 
-#ifdef SWIGRUBY
-%alias RepoType::asString "to_s";
+#if defined(SWIGPYTHON) || defined(SWIGRUBY)
+%rename RepoType::asString "__str__";
 #endif
 
 struct RepoType
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-bindings-0.4.2/swig/ruby/CMakeLists.txt new/libzypp-bindings-0.4.2/swig/ruby/CMakeLists.txt
--- old/libzypp-bindings-0.4.2/swig/ruby/CMakeLists.txt 2007-08-29 00:01:05.000000000 +0200
+++ new/libzypp-bindings-0.4.2/swig/ruby/CMakeLists.txt 2007-08-30 17:36:55.000000000 +0200
@@ -2,10 +2,12 @@
 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-strict-aliasing")
 
 FIND_PACKAGE(Ruby REQUIRED)
-EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['vendorarchdir']"
-   OUTPUT_VARIABLE RUBY_VENDOR_ARCH_DIR)
-MESSAGE( STATUS "Ruby vendor arch dir: ${RUBY_VENDOR_ARCH_DIR}" )
-MESSAGE( STATUS "Ruby include path: ${RUBY_INCLUDE_PATH}" )
+
+EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['vendorarchdir']" OUTPUT_VARIABLE RUBY_VENDOR_ARCH_DIR)
+
+MESSAGE(STATUS "Ruby executable: ${RUBY_EXECUTABLE}")
+MESSAGE(STATUS "Ruby vendor arch dir: ${RUBY_VENDOR_ARCH_DIR}")
+MESSAGE(STATUS "Ruby include path: ${RUBY_INCLUDE_PATH}")
 
 SET( SWIG_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/zypp_wrap.cxx" )
 SET( SWIG_INPUT "${CMAKE_CURRENT_SOURCE_DIR}/zypp.i" )


++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++



Remember to have fun...

---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-commit+help@xxxxxxxxxxxx

< Previous Next >