summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gr-uhd/swig/__init__.py6
-rw-r--r--gr-uhd/swig/uhd_swig.i11
2 files changed, 6 insertions, 11 deletions
diff --git a/gr-uhd/swig/__init__.py b/gr-uhd/swig/__init__.py
index 0fdacb796..6d09f19f0 100644
--- a/gr-uhd/swig/__init__.py
+++ b/gr-uhd/swig/__init__.py
@@ -30,6 +30,12 @@ from uhd_swig import *
# Add other content from pure-Python modules here
########################################################################
+#make the meta-range printable in python
+meta_range_t.__str__ = lambda s: s.to_pp_string().strip()
+
+class freq_range_t(meta_range_t): pass #a typedef for the user
+class gain_range_t(meta_range_t): pass #a typedef for the user
+
class tune_request_t(tune_request_t, float):
"""
Make the python tune request object inherit from float
diff --git a/gr-uhd/swig/uhd_swig.i b/gr-uhd/swig/uhd_swig.i
index 76f44a491..cf4ecf920 100644
--- a/gr-uhd/swig/uhd_swig.i
+++ b/gr-uhd/swig/uhd_swig.i
@@ -73,17 +73,6 @@ namespace std {
%include <uhd/types/time_spec.hpp>
%include <uhd/types/clock_config.hpp>
-//Re-create range typedefs here with %template as they are not imported.
-//Replicate all the levels of templated inheritance so swig understands.
-
-%template(float_range_t) uhd::range_t<float>;
-%template(_float_range_vector_t) std::vector<uhd::range_t<float> >;
-%template(gain_range_t) uhd::meta_range_t<float>;
-
-%template(double_range_t) uhd::range_t<double>;
-%template(_double_range_vector_t) std::vector<uhd::range_t<double> >;
-%template(freq_range_t) uhd::meta_range_t<double>;
-
////////////////////////////////////////////////////////////////////////
// block magic
////////////////////////////////////////////////////////////////////////