summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Rondeau <trondeau@vt.edu>2013-04-15 13:10:33 -0400
committerTom Rondeau <trondeau@vt.edu>2013-04-15 13:10:33 -0400
commit183d6eed0dca917a6d630604159b5becb7ccbcdc (patch)
tree1ca83e75587db0d09756d80a792718bad55f6ead
parent427b8efd03394b724a2bf646f57aa49fe49374a5 (diff)
uhd: 1. made a python directory for gr-uhd for tlc consistency.
2. forcing use of builtin's map function so no confusion with pmt's map.
-rw-r--r--gr-uhd/CMakeLists.txt1
-rw-r--r--gr-uhd/python/CMakeLists.txt50
-rw-r--r--gr-uhd/python/__init__.py (renamed from gr-uhd/swig/__init__.py)2
-rwxr-xr-xgr-uhd/python/qa_uhd.py (renamed from gr-uhd/swig/qa_uhd.py)0
-rw-r--r--gr-uhd/swig/CMakeLists.txt6
-rw-r--r--gr-uhd/swig/gnuradio/uhd.scm27
6 files changed, 52 insertions, 34 deletions
diff --git a/gr-uhd/CMakeLists.txt b/gr-uhd/CMakeLists.txt
index faec68859b..41926a446c 100644
--- a/gr-uhd/CMakeLists.txt
+++ b/gr-uhd/CMakeLists.txt
@@ -98,6 +98,7 @@ add_subdirectory(doc)
add_subdirectory(examples/c++)
if(ENABLE_PYTHON)
add_subdirectory(swig)
+ add_subdirectory(python)
add_subdirectory(grc)
add_subdirectory(apps)
add_subdirectory(examples/python)
diff --git a/gr-uhd/python/CMakeLists.txt b/gr-uhd/python/CMakeLists.txt
new file mode 100644
index 0000000000..ac113fe2d2
--- /dev/null
+++ b/gr-uhd/python/CMakeLists.txt
@@ -0,0 +1,50 @@
+# Copyright 2011-212 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.
+
+########################################################################
+# Setup python install
+########################################################################
+include(GrPython)
+
+GR_PYTHON_INSTALL(
+ FILES
+ __init__.py
+ DESTINATION ${GR_PYTHON_DIR}/gnuradio/uhd
+ COMPONENT "uhd_python"
+)
+
+########################################################################
+# Handle the unit tests
+########################################################################
+if(ENABLE_TESTING)
+
+list(APPEND GR_TEST_PYTHON_DIRS
+ ${CMAKE_BINARY_DIR}/gr-uhd/python
+ ${CMAKE_BINARY_DIR}/gr-uhd/swig
+)
+
+list(APPEND GR_TEST_TARGET_DEPS gnuradio-uhd)
+
+include(GrTest)
+file(GLOB py_qa_test_files "qa_*.py")
+foreach(py_qa_test_file ${py_qa_test_files})
+ get_filename_component(py_qa_test_name ${py_qa_test_file} NAME_WE)
+ GR_ADD_TEST(${py_qa_test_name} ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B} ${py_qa_test_file})
+endforeach(py_qa_test_file)
+endif(ENABLE_TESTING)
diff --git a/gr-uhd/swig/__init__.py b/gr-uhd/python/__init__.py
index 54a058c452..a07397334e 100644
--- a/gr-uhd/swig/__init__.py
+++ b/gr-uhd/python/__init__.py
@@ -93,7 +93,7 @@ def _prepare_uhd_swig():
new_dev_addr = uhd_swig.device_addr_t()
for key in dev_addr.keys(): new_dev_addr[key] = dev_addr.get(key)
return new_dev_addr
- return map(to_pythonized_dev_addr, uhd_swig.find_devices_raw(*args, **kwargs))
+ return __builtins__['map'](to_pythonized_dev_addr, uhd_swig.find_devices_raw(*args, **kwargs))
setattr(uhd_swig, 'find_devices', find_devices)
#Cast constructor args (FIXME swig handle overloads?)
diff --git a/gr-uhd/swig/qa_uhd.py b/gr-uhd/python/qa_uhd.py
index 00757369ff..00757369ff 100755
--- a/gr-uhd/swig/qa_uhd.py
+++ b/gr-uhd/python/qa_uhd.py
diff --git a/gr-uhd/swig/CMakeLists.txt b/gr-uhd/swig/CMakeLists.txt
index 5052c68e0b..94d84a64bc 100644
--- a/gr-uhd/swig/CMakeLists.txt
+++ b/gr-uhd/swig/CMakeLists.txt
@@ -58,9 +58,3 @@ install(
DESTINATION ${GR_INCLUDE_DIR}/gnuradio/swig
COMPONENT "uhd_swig"
)
-
-GR_PYTHON_INSTALL(
- FILES __init__.py
- DESTINATION ${GR_PYTHON_DIR}/gnuradio/uhd
- COMPONENT "uhd_python"
-)
diff --git a/gr-uhd/swig/gnuradio/uhd.scm b/gr-uhd/swig/gnuradio/uhd.scm
deleted file mode 100644
index 906aef2a6d..0000000000
--- a/gr-uhd/swig/gnuradio/uhd.scm
+++ /dev/null
@@ -1,27 +0,0 @@
-;;;
-;;; Copyright 2010 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 this program. If not, see <http://www.gnu.org/licenses/>.
-;;;
-
-;;; Semi bogus module that just reexports the uhd_swig module
-
-(define-module (gnuradio uhd)
- #:use-module (gnuradio export-safely)
- #:use-module (gnuradio uhd_swig)
- #:duplicates (merge-generics replace check))
-
-(re-export-all '(gnuradio uhd_swig))