From 9e625c4821f4c63421b3d3747c0c4f358fef6c5f Mon Sep 17 00:00:00 2001
From: Douglas Anderson <danderson@ntia.doc.gov>
Date: Sun, 12 Feb 2017 15:52:19 -0800
Subject: python3: update non-GRC components to use python2 or python3

---
 gr-analog/python/analog/wfm_tx.py | 26 +++++++++++++++-----------
 1 file changed, 15 insertions(+), 11 deletions(-)

(limited to 'gr-analog/python/analog/wfm_tx.py')

diff --git a/gr-analog/python/analog/wfm_tx.py b/gr-analog/python/analog/wfm_tx.py
index a1b589350d..9f49ca3ca2 100644
--- a/gr-analog/python/analog/wfm_tx.py
+++ b/gr-analog/python/analog/wfm_tx.py
@@ -19,15 +19,19 @@
 # Boston, MA 02110-1301, USA.
 #
 
+from __future__ import print_function
+from __future__ import absolute_import
+from __future__ import division
+from __future__ import unicode_literals
+
 import math
+
 from gnuradio import gr
 from gnuradio import filter
-from fm_emph import fm_preemph
 
-try:
-    from gnuradio import analog
-except ImportError:
-    import analog_swig as analog
+from . import analog_swig as analog
+from .fm_emph import fm_preemph
+
 
 class wfm_tx(gr.hier_block2):
     def __init__(self, audio_rate, quad_rate, tau=75e-6, max_dev=75e3, fh=-1.0):
@@ -46,16 +50,16 @@ class wfm_tx(gr.hier_block2):
 
         quad_rate must be an integer multiple of audio_rate.
         """
-	gr.hier_block2.__init__(self, "wfm_tx",
-				gr.io_signature(1, 1, gr.sizeof_float),      # Input signature
-				gr.io_signature(1, 1, gr.sizeof_gr_complex)) # Output signature
+        gr.hier_block2.__init__(self, "wfm_tx",
+                                gr.io_signature(1, 1, gr.sizeof_float),      # Input signature
+                                gr.io_signature(1, 1, gr.sizeof_gr_complex)) # Output signature
 
         # FIXME audio_rate and quad_rate ought to be exact rationals
         audio_rate = int(audio_rate)
         quad_rate = int(quad_rate)
 
         if quad_rate % audio_rate != 0:
-            raise ValueError, "quad_rate is not an integer multiple of audio_rate"
+            raise ValueError("quad_rate is not an integer multiple of audio_rate")
 
 
         do_interp = audio_rate != quad_rate
@@ -66,10 +70,10 @@ class wfm_tx(gr.hier_block2):
                                                  quad_rate,       # Fs
                                                  16000,           # passband cutoff
                                                  18000,           # stopband cutoff
-                                                 0.1,   	  # passband ripple dB
+                                                 0.1,             # passband ripple dB
                                                  40)              # stopband atten dB
 
-            print "len(interp_taps) =", len(interp_taps)
+            print("len(interp_taps) =", len(interp_taps))
             self.interpolator = filter.interp_fir_filter_fff (interp_factor, interp_taps)
 
         self.preemph = fm_preemph(quad_rate, tau=tau, fh=fh)
-- 
cgit v1.2.3