diff options
author | Arvin Schnell <aschnell@suse.de> | 2007-07-24 15:14:37 +0000 |
---|---|---|
committer | Arvin Schnell <aschnell@suse.de> | 2007-07-24 15:14:37 +0000 |
commit | 0e7b83072657c2f76fe17f1edd7aac3c84f2f8eb (patch) | |
tree | 8e25601b5bb836ef685c91b7b801e8d7984326c9 /swig/python | |
parent | 84b45fc399083c1d77f70b080344a9f68b67179f (diff) | |
download | libzypp-bindings-0e7b83072657c2f76fe17f1edd7aac3c84f2f8eb.tar.gz libzypp-bindings-0e7b83072657c2f76fe17f1edd7aac3c84f2f8eb.tar.bz2 libzypp-bindings-0e7b83072657c2f76fe17f1edd7aac3c84f2f8eb.zip |
- some cleanup
Diffstat (limited to 'swig/python')
-rw-r--r-- | swig/python/CMakeLists.txt | 4 | ||||
-rw-r--r-- | swig/python/python.i | 13 |
2 files changed, 16 insertions, 1 deletions
diff --git a/swig/python/CMakeLists.txt b/swig/python/CMakeLists.txt index 9d7158d..591940d 100644 --- a/swig/python/CMakeLists.txt +++ b/swig/python/CMakeLists.txt @@ -1,4 +1,6 @@ +SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-strict-aliasing") + FIND_PACKAGE(PythonLibs REQUIRED) MESSAGE( STATUS "Python include path: ${PYTHON_INCLUDE_PATH}" ) @@ -18,7 +20,7 @@ ADD_CUSTOM_COMMAND ( COMMAND ${SWIG_EXECUTABLE} -c++ -python -xmlout ${CMAKE_CURRENT_BINARY_DIR}/parse.xml -o ${CMAKE_CURRENT_BINARY_DIR}/zypp_wrap.cxx -I${ZYPP_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/../zypp.i COMMAND ${CMAKE_COMMAND} -E echo "Done." WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/../*.i + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/../*.i ${CMAKE_CURRENT_SOURCE_DIR}/*.i ) ADD_CUSTOM_TARGET( glue diff --git a/swig/python/python.i b/swig/python/python.i new file mode 100644 index 0000000..f7826ec --- /dev/null +++ b/swig/python/python.i @@ -0,0 +1,13 @@ + +%define iter( cls ) +%extend cls { + %pythoncode %{ + def __iter__(self): + r = self.range() + while not r.empty(): + yield r.head() + r.removeFirst() + %} +}; +%enddef + |