summaryrefslogtreecommitdiff
path: root/gnuradio-runtime/lib
diff options
context:
space:
mode:
authorMarcus Müller <marcus@hostalia.de>2018-06-25 19:28:29 +0200
committerMarcus Müller <marcus@hostalia.de>2018-06-25 19:28:29 +0200
commit03ae7938351f01313d30a41927ffb77670fcca14 (patch)
tree586744f0e2b7560dc161f2a7a60030155d43ce8a /gnuradio-runtime/lib
parentd78f7fcd0dadd362fcdc99194da5343a506eb519 (diff)
parentc66aec4dfae559004e88da968d1ce57584e144ee (diff)
Merge branch 'next_python3' into next
This brings Python3 to `next`. It also brings * a bump in SWIG dependency version * various GRC improvements, * YAML instead of XML in GRC * a lot of broken unit tests
Diffstat (limited to 'gnuradio-runtime/lib')
-rw-r--r--gnuradio-runtime/lib/CMakeLists.txt6
-rw-r--r--[-rwxr-xr-x]gnuradio-runtime/lib/math/gen_sine_table.py6
-rw-r--r--gnuradio-runtime/lib/pmt/CMakeLists.txt2
-rw-r--r--gnuradio-runtime/lib/pmt/gen-serial-tags.py5
-rw-r--r--[-rwxr-xr-x]gnuradio-runtime/lib/pmt/generate_unv.py3
-rw-r--r--gnuradio-runtime/lib/sptr_magic.cc2
6 files changed, 15 insertions, 9 deletions
diff --git a/gnuradio-runtime/lib/CMakeLists.txt b/gnuradio-runtime/lib/CMakeLists.txt
index 5e414164f8..4fd5a610f6 100644
--- a/gnuradio-runtime/lib/CMakeLists.txt
+++ b/gnuradio-runtime/lib/CMakeLists.txt
@@ -24,7 +24,7 @@ GR_CHECK_HDR_N_DEF(sys/resource.h HAVE_SYS_RESOURCE_H)
# Handle the generated constants
########################################################################
execute_process(COMMAND ${PYTHON_EXECUTABLE} -c
- "import time;print time.strftime('%a, %d %b %Y %H:%M:%S', time.gmtime())"
+ "import time;print(time.strftime('%a, %d %b %Y %H:%M:%S', time.gmtime()))"
OUTPUT_VARIABLE BUILD_DATE OUTPUT_STRIP_TRAILING_WHITESPACE
)
message(STATUS "Loading build date ${BUILD_DATE} into constants...")
@@ -48,8 +48,8 @@ list(APPEND gnuradio_runtime_sources ${CMAKE_CURRENT_BINARY_DIR}/constants.cc)
########################################################################
include_directories(${GNURADIO_RUNTIME_INCLUDE_DIRS}
${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_CURRENT_BINARY_DIR}/../include/
- ${VOLK_INCLUDE_DIRS}
+ ${CMAKE_CURRENT_BINARY_DIR}/../include/
+ ${VOLK_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS}
)
diff --git a/gnuradio-runtime/lib/math/gen_sine_table.py b/gnuradio-runtime/lib/math/gen_sine_table.py
index d7d11eff11..75e3a0c58f 100755..100644
--- a/gnuradio-runtime/lib/math/gen_sine_table.py
+++ b/gnuradio-runtime/lib/math/gen_sine_table.py
@@ -20,6 +20,8 @@
# Boston, MA 02110-1301, USA.
#
+from __future__ import division
+from __future__ import unicode_literals
import math
import sys
@@ -38,8 +40,8 @@ def gen_approx_table (f, nentries, min_x, max_x):
for i in range (nentries):
a = (i * incx) + min_x
b = ((i + 1) * incx) + min_x
- m = (f(b)-f(a))/(b-a)
- c = (3*a+b)*(f(a)-f(b))/(4*(b-a)) + (f((a+b)/2) + f(a))/2
+ m = (f(b)-f(a)) / (b-a)
+ c = (3*a+b)*(f(a)-f(b))/(4*(b-a)) + (f(old_div((a+b) / 2) + f(a)),2)
abs_error = c+m*a-f(a)
r.append ((m, c, abs_error))
return r
diff --git a/gnuradio-runtime/lib/pmt/CMakeLists.txt b/gnuradio-runtime/lib/pmt/CMakeLists.txt
index e5c8f2f47e..85b2a4d6e0 100644
--- a/gnuradio-runtime/lib/pmt/CMakeLists.txt
+++ b/gnuradio-runtime/lib/pmt/CMakeLists.txt
@@ -66,7 +66,7 @@ add_custom_command(
${CMAKE_CURRENT_SOURCE_DIR}/unv_template.h.t
${CMAKE_CURRENT_SOURCE_DIR}/unv_template.cc.t
${CMAKE_CURRENT_SOURCE_DIR}/unv_qa_template.cc.t
- COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B} -c
+ COMMAND ${PYTHON_EXECUTABLE} -B -c
"import os, sys; srcdir='${CMAKE_CURRENT_SOURCE_DIR}'; sys.path.append(srcdir); os.environ['srcdir']=srcdir; from generate_unv import main; main()"
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
VERBATIM
diff --git a/gnuradio-runtime/lib/pmt/gen-serial-tags.py b/gnuradio-runtime/lib/pmt/gen-serial-tags.py
index 18e927beb5..2ff2240a47 100644
--- a/gnuradio-runtime/lib/pmt/gen-serial-tags.py
+++ b/gnuradio-runtime/lib/pmt/gen-serial-tags.py
@@ -32,11 +32,14 @@ enum pst_tags {
#endif /* INCLUDED_PMT_SERIAL_TAGS_H */
"""
+from __future__ import print_function
+from __future__ import unicode_literals
+
import sys, os, re
if __name__ == '__main__':
if len(sys.argv) != 3:
- print "Usage %s <input_scm_file> <output_hdr_file>"%__file__
+ print("Usage %s <input_scm_file> <output_hdr_file>"%__file__)
exit()
input_scm_file, output_hdr_file = sys.argv[1:]
enums = list()
diff --git a/gnuradio-runtime/lib/pmt/generate_unv.py b/gnuradio-runtime/lib/pmt/generate_unv.py
index 6218099fc1..45c57a3fb8 100755..100644
--- a/gnuradio-runtime/lib/pmt/generate_unv.py
+++ b/gnuradio-runtime/lib/pmt/generate_unv.py
@@ -23,6 +23,7 @@
"""
Generate code for uniform numeric vectors
"""
+from __future__ import unicode_literals
import re, os, os.path
@@ -93,7 +94,7 @@ using namespace pmt;
# set srcdir to the directory that contains Makefile.am
try:
srcdir = os.environ['srcdir']
-except KeyError, e:
+except KeyError as e:
srcdir = "."
srcdir = srcdir + '/'
diff --git a/gnuradio-runtime/lib/sptr_magic.cc b/gnuradio-runtime/lib/sptr_magic.cc
index e5e83722fc..bffef04756 100644
--- a/gnuradio-runtime/lib/sptr_magic.cc
+++ b/gnuradio-runtime/lib/sptr_magic.cc
@@ -102,4 +102,4 @@ namespace gnuradio {
s_map.erase(pos);
return sptr;
}
-};
+}