commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] [gnuradio] 07/46: zeromq: first try at enabling Python


From: git
Subject: [Commit-gnuradio] [gnuradio] 07/46: zeromq: first try at enabling Python. Segfaults in SWIG code.
Date: Fri, 16 May 2014 19:37:13 +0000 (UTC)

This is an automated email from the git hooks/post-receive script.

jcorgan pushed a commit to branch master
in repository gnuradio.

commit 254b51f46e81ed6ed0f21f026514848cdf73b6be
Author: Johnathan Corgan <address@hidden>
Date:   Sun Dec 8 13:29:07 2013 -0800

    zeromq: first try at enabling Python.  Segfaults in SWIG code.
---
 gr-zeromq/CMakeLists.txt                           |  2 +-
 .../python/{zmqblocks => zeromq}/CMakeLists.txt    |  4 +-
 gr-zeromq/python/zeromq/__init__.py                | 36 ++++++++++++++
 .../python/{zmqblocks => zeromq}/probe_manager.py  | 15 +++---
 .../python/{zmqblocks => zeromq}/rpc_manager.py    | 12 ++---
 gr-zeromq/python/zmqblocks/__init__.py             | 56 ----------------------
 6 files changed, 52 insertions(+), 73 deletions(-)

diff --git a/gr-zeromq/CMakeLists.txt b/gr-zeromq/CMakeLists.txt
index ef46b71..d96b043 100644
--- a/gr-zeromq/CMakeLists.txt
+++ b/gr-zeromq/CMakeLists.txt
@@ -89,7 +89,7 @@ add_subdirectory(include/gnuradio/zeromq)
 add_subdirectory(lib)
 if(ENABLE_PYTHON)
     add_subdirectory(swig)
-#    add_subdirectory(python/zeromq)
+    add_subdirectory(python/zeromq)
 #    add_subdirectory(grc)
 #    add_subdirectory(examples)
 endif(ENABLE_PYTHON)
diff --git a/gr-zeromq/python/zmqblocks/CMakeLists.txt 
b/gr-zeromq/python/zeromq/CMakeLists.txt
similarity index 94%
rename from gr-zeromq/python/zmqblocks/CMakeLists.txt
rename to gr-zeromq/python/zeromq/CMakeLists.txt
index b3175bc..9185682 100644
--- a/gr-zeromq/python/zmqblocks/CMakeLists.txt
+++ b/gr-zeromq/python/zeromq/CMakeLists.txt
@@ -33,7 +33,7 @@ GR_PYTHON_INSTALL(
     __init__.py
     rpc_manager.py
     probe_manager.py
-    DESTINATION ${GR_PYTHON_DIR}/zmqblocks
+    DESTINATION ${GR_PYTHON_DIR}/gnuradio/zeromq
 )
 
 ########################################################################
@@ -41,5 +41,5 @@ GR_PYTHON_INSTALL(
 ########################################################################
 include(GrTest)
 
-set(GR_TEST_TARGET_DEPS gnuradio-zmqblocks)
+set(GR_TEST_TARGET_DEPS gnuradio-zeromq)
 set(GR_TEST_PYTHON_DIRS ${CMAKE_BINARY_DIR}/swig)
diff --git a/gr-zeromq/python/zeromq/__init__.py 
b/gr-zeromq/python/zeromq/__init__.py
new file mode 100644
index 0000000..cab4b67
--- /dev/null
+++ b/gr-zeromq/python/zeromq/__init__.py
@@ -0,0 +1,36 @@
+#
+# Copyright 2013 Free Software Foundation, Inc.
+#
+# This file is part of GNU Radio
+#
+# GNU Radio is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# GNU Radio is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Radio; see the file COPYING.  If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street,
+# Boston, MA 02110-1301, USA.
+#
+
+'''
+Blocks for interfacing with ZeroMQ endpoints.
+'''
+
+import os
+
+try:
+    from zeromq_swig import *
+except ImportError:
+    dirname, filename = os.path.split(os.path.abspath(__file__))
+    __path__.append(os.path.join(dirname, "..", "..", "swig"))
+    from zeromq_swig import *
+
+from probe_manager import probe_manager
+from rpc_manager import rpc_manager
diff --git a/gr-zeromq/python/zmqblocks/probe_manager.py 
b/gr-zeromq/python/zeromq/probe_manager.py
similarity index 90%
rename from gr-zeromq/python/zmqblocks/probe_manager.py
rename to gr-zeromq/python/zeromq/probe_manager.py
index a402e62..c30e6ea 100644
--- a/gr-zeromq/python/zmqblocks/probe_manager.py
+++ b/gr-zeromq/python/zeromq/probe_manager.py
@@ -1,24 +1,23 @@
 #
-# Copyright 2013 Institute for Theoretical Information Technology,
-#                RWTH Aachen University
-# 
-# Authors: Johannes Schmitz <address@hidden>
-# 
+# Copyright 2013 Free Software Foundation, Inc.
+#
+# This file is part of GNU Radio.
+#
 # This is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 # the Free Software Foundation; either version 3, or (at your option)
 # any later version.
-# 
+#
 # This software is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU General Public License
 # along with this software; see the file COPYING.  If not, write to
 # the Free Software Foundation, Inc., 51 Franklin Street,
 # Boston, MA 02110-1301, USA.
-# 
+#
 
 import zmq
 import threading
diff --git a/gr-zeromq/python/zmqblocks/rpc_manager.py 
b/gr-zeromq/python/zeromq/rpc_manager.py
similarity index 99%
rename from gr-zeromq/python/zmqblocks/rpc_manager.py
rename to gr-zeromq/python/zeromq/rpc_manager.py
index 006dbc6..e50a3d6 100644
--- a/gr-zeromq/python/zmqblocks/rpc_manager.py
+++ b/gr-zeromq/python/zeromq/rpc_manager.py
@@ -1,24 +1,24 @@
-# 
+#
 # Copyright 2013 Institute for Theoretical Information Technology,
 #                RWTH Aachen University
-# 
+#
 # Authors: Johannes Schmitz <address@hidden>
-# 
+#
 # This is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 # the Free Software Foundation; either version 3, or (at your option)
 # any later version.
-# 
+#
 # This software is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU General Public License
 # along with this software; see the file COPYING.  If not, write to
 # the Free Software Foundation, Inc., 51 Franklin Street,
 # Boston, MA 02110-1301, USA.
-# 
+#
 
 import zmq
 import pmt
diff --git a/gr-zeromq/python/zmqblocks/__init__.py 
b/gr-zeromq/python/zmqblocks/__init__.py
deleted file mode 100644
index b11d50a..0000000
--- a/gr-zeromq/python/zmqblocks/__init__.py
+++ /dev/null
@@ -1,56 +0,0 @@
-#
-# Copyright 2008,2009 Free Software Foundation, Inc.
-#
-# This application is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3, or (at your option)
-# any later version.
-#
-# This application is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-
-# The presence of this file turns this directory into a Python package
-
-'''
-This is the GNU Radio ZMQBLOCKS module. Place your Python package
-description here (python/__init__.py).
-'''
-
-# ----------------------------------------------------------------
-# Temporary workaround for ticket:181 (swig+python problem)
-import sys
-_RTLD_GLOBAL = 0
-try:
-    from dl import RTLD_GLOBAL as _RTLD_GLOBAL
-except ImportError:
-    try:
-       from DLFCN import RTLD_GLOBAL as _RTLD_GLOBAL
-    except ImportError:
-       pass
-
-if _RTLD_GLOBAL != 0:
-    _dlopenflags = sys.getdlopenflags()
-    sys.setdlopenflags(_dlopenflags|_RTLD_GLOBAL)
-# ----------------------------------------------------------------
-
-
-# import swig generated symbols into the zmqblocks namespace
-from zmqblocks_swig import *
-
-# import any pure python here
-from rpc_manager import rpc_manager
-from probe_manager import probe_manager
-#
-
-# ----------------------------------------------------------------
-# Tail of workaround
-if _RTLD_GLOBAL != 0:
-    sys.setdlopenflags(_dlopenflags)      # Restore original flags
-# ----------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]