commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] [gnuradio] 11/20: python3: update gr-qtgui for python3


From: git
Subject: [Commit-gnuradio] [gnuradio] 11/20: python3: update gr-qtgui for python3 support
Date: Sun, 25 Dec 2016 03:59:59 +0000 (UTC)

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

jcorgan pushed a commit to branch python3
in repository gnuradio.

commit 65c504de471fe1d7603bb431525d72cfe5eebc65
Author: Douglas Anderson <address@hidden>
Date:   Thu Dec 22 12:53:58 2016 -0700

    python3: update gr-qtgui for python3 support
---
 gr-qtgui/apps/gr_constellation_plot      |  6 ++++--
 gr-qtgui/apps/plot_base.py               | 32 +++++++++++++++++---------------
 gr-qtgui/apps/plot_constellation_form.py |  4 +++-
 gr-qtgui/apps/plot_form.py               |  4 +++-
 gr-qtgui/apps/plot_psd_base.py           |  6 ++++--
 gr-qtgui/apps/plot_psd_form.py           |  4 +++-
 gr-qtgui/apps/plot_spectrogram_base.py   |  6 ++++--
 gr-qtgui/apps/plot_spectrogram_form.py   |  4 +++-
 gr-qtgui/apps/plot_time_base.py          |  6 ++++--
 gr-qtgui/apps/plot_time_form.py          |  4 +++-
 gr-qtgui/apps/plot_time_raster_base.py   |  6 ++++--
 gr-qtgui/apps/plot_time_raster_form.py   |  6 +++---
 gr-qtgui/python/qtgui/util.py.cmakein    |  5 ++++-
 13 files changed, 59 insertions(+), 34 deletions(-)

diff --git a/gr-qtgui/apps/gr_constellation_plot 
b/gr-qtgui/apps/gr_constellation_plot
index ff5db1a..fe5bdb5 100755
--- a/gr-qtgui/apps/gr_constellation_plot
+++ b/gr-qtgui/apps/gr_constellation_plot
@@ -20,6 +20,8 @@
 # Boston, MA 02110-1301, USA.
 #
 
+from __future__ import print_function
+
 from gnuradio import gr
 from gnuradio import blocks
 from gnuradio.eng_arg import eng_float, intx
@@ -31,13 +33,13 @@ try:
     from PyQt4 import QtGui, QtCore
     import sip
 except ImportError:
-    print "Error: Program requires PyQt4 and gr-qtgui."
+    print("Error: Program requires PyQt4 and gr-qtgui.")
     sys.exit(1)
 
 try:
     import scipy
 except ImportError:
-    print "Error: Scipy required (www.scipy.org)."
+    print("Error: Scipy required (www.scipy.org).")
     sys.exit(1)
 
 try:
diff --git a/gr-qtgui/apps/plot_base.py b/gr-qtgui/apps/plot_base.py
index 7a039e2..83526f9 100644
--- a/gr-qtgui/apps/plot_base.py
+++ b/gr-qtgui/apps/plot_base.py
@@ -20,6 +20,8 @@
 # Boston, MA 02110-1301, USA.
 #
 
+from __future__ import print_function
+
 from gnuradio import gr, blocks
 import os, sys
 
@@ -30,13 +32,13 @@ try:
     from PyQt4 import QtGui, QtCore
     import sip
 except ImportError:
-    print "Error: Program requires PyQt4 and gr-qtgui."
+    print("Error: Program requires PyQt4 and gr-qtgui.")
     sys.exit(1)
 
 try:
     import scipy
 except ImportError:
-    print "Error: Scipy required (www.scipy.org)."
+    print("Error: Scipy required (www.scipy.org).")
     sys.exit(1)
 
 try:
@@ -64,8 +66,8 @@ def read_samples(filename, start, in_size, min_size, dtype, 
dtype_size):
 
     if(min_size > 0):
         if(len(data) < in_size):
-            print "Warning: read in {0} samples but asked for {1} 
samples.".format(
-                len(data), in_size)
+            print("Warning: read in {0} samples but asked for {1} 
samples.".format(
+                len(data), in_size))
     else:
         # If we have to, append 0's to create min_size samples of data
         if(len(data) < min_size):
@@ -108,8 +110,8 @@ def read_samples_c(filename, start, in_size, min_size=0):
 
     if(min_size > 0):
         if(len(data) < in_size):
-            print "Warning: read in {0} samples but asked for {1} 
samples.".format(
-                len(data), in_size)
+            print("Warning: read in {0} samples but asked for {1} 
samples.".format(
+                len(data), in_size))
     else:
         # If we have to, append 0's to create min_size samples of data
         if(len(data) < min_size):
@@ -119,9 +121,9 @@ def read_samples_c(filename, start, in_size, min_size=0):
 
 class source_ints_to_float(gr.hier_block2):
     def __init__(self, data):
-       gr.hier_block2.__init__(self, "ints_to_floats",
-                               gr.io_signature(0, 0, 0),
-                               gr.io_signature(1, 1, gr.sizeof_float))
+        gr.hier_block2.__init__(self, "ints_to_floats",
+                                gr.io_signature(0, 0, 0),
+                                gr.io_signature(1, 1, gr.sizeof_float))
         self.src = blocks.vector_source_i(data)
         self.cvt = blocks.int_to_float()
         self.connect(self.src, self.cvt, self)
@@ -131,9 +133,9 @@ class source_ints_to_float(gr.hier_block2):
 
 class source_shorts_to_float(gr.hier_block2):
     def __init__(self, data):
-       gr.hier_block2.__init__(self, "shorts_to_floats",
-                               gr.io_signature(0, 0, 0),
-                               gr.io_signature(1, 1, gr.sizeof_float))
+        gr.hier_block2.__init__(self, "shorts_to_floats",
+                                gr.io_signature(0, 0, 0),
+                                gr.io_signature(1, 1, gr.sizeof_float))
         self.src = blocks.vector_source_s(data)
         self.cvt = blocks.short_to_float()
         self.connect(self.src, self.cvt, self)
@@ -143,9 +145,9 @@ class source_shorts_to_float(gr.hier_block2):
 
 class source_chars_to_float(gr.hier_block2):
     def __init__(self, data):
-       gr.hier_block2.__init__(self, "chars_to_floats",
-                               gr.io_signature(0, 0, 0),
-                               gr.io_signature(1, 1, gr.sizeof_float))
+        gr.hier_block2.__init__(self, "chars_to_floats",
+                                gr.io_signature(0, 0, 0),
+                                gr.io_signature(1, 1, gr.sizeof_float))
         self.src = blocks.vector_source_b(data)
         self.cvt = blocks.char_to_float()
         self.connect(self.src, self.cvt, self)
diff --git a/gr-qtgui/apps/plot_constellation_form.py 
b/gr-qtgui/apps/plot_constellation_form.py
index 01c6ed1..2ee06a4 100644
--- a/gr-qtgui/apps/plot_constellation_form.py
+++ b/gr-qtgui/apps/plot_constellation_form.py
@@ -20,6 +20,8 @@
 # Boston, MA 02110-1301, USA.
 #
 
+from __future__ import print_function
+
 import sys
 from gnuradio import filter
 
@@ -27,7 +29,7 @@ try:
     from PyQt4 import QtGui, QtCore
     import sip
 except ImportError:
-    print "Error: Program requires PyQt4."
+    print("Error: Program requires PyQt4.")
     sys.exit(1)
 
 try:
diff --git a/gr-qtgui/apps/plot_form.py b/gr-qtgui/apps/plot_form.py
index 931565b..2cebd5c 100644
--- a/gr-qtgui/apps/plot_form.py
+++ b/gr-qtgui/apps/plot_form.py
@@ -20,11 +20,13 @@
 # Boston, MA 02110-1301, USA.
 #
 
+from __future__ import print_function
+
 try:
     from PyQt4 import QtGui, QtCore
     import sip
 except ImportError:
-    print "Error: Program requires PyQt4."
+    print("Error: Program requires PyQt4.")
     sys.exit(1)
 
 import numpy
diff --git a/gr-qtgui/apps/plot_psd_base.py b/gr-qtgui/apps/plot_psd_base.py
index c3c03ec..bfe5383 100644
--- a/gr-qtgui/apps/plot_psd_base.py
+++ b/gr-qtgui/apps/plot_psd_base.py
@@ -20,6 +20,8 @@
 # Boston, MA 02110-1301, USA.
 #
 
+from __future__ import print_function
+
 from gnuradio import gr, blocks
 from gnuradio.eng_arg import eng_float, intx
 from argparse import ArgumentParser
@@ -30,13 +32,13 @@ try:
     from PyQt4 import QtGui, QtCore
     import sip
 except ImportError:
-    print "Error: Program requires PyQt4 and gr-qtgui."
+    print("Error: Program requires PyQt4 and gr-qtgui.")
     sys.exit(1)
 
 try:
     import scipy
 except ImportError:
-    print "Error: Scipy required (www.scipy.org)."
+    print("Error: Scipy required (www.scipy.org).")
     sys.exit(1)
 
 try:
diff --git a/gr-qtgui/apps/plot_psd_form.py b/gr-qtgui/apps/plot_psd_form.py
index 2d1fcd1..98ad0a7 100644
--- a/gr-qtgui/apps/plot_psd_form.py
+++ b/gr-qtgui/apps/plot_psd_form.py
@@ -20,6 +20,8 @@
 # Boston, MA 02110-1301, USA.
 #
 
+from __future__ import print_function
+
 import sys
 from gnuradio import filter
 
@@ -27,7 +29,7 @@ try:
     from PyQt4 import QtGui, QtCore
     import sip
 except ImportError:
-    print "Error: Program requires PyQt4."
+    print("Error: Program requires PyQt4.")
     sys.exit(1)
 
 try:
diff --git a/gr-qtgui/apps/plot_spectrogram_base.py 
b/gr-qtgui/apps/plot_spectrogram_base.py
index f568100..dfc7763 100644
--- a/gr-qtgui/apps/plot_spectrogram_base.py
+++ b/gr-qtgui/apps/plot_spectrogram_base.py
@@ -20,6 +20,8 @@
 # Boston, MA 02110-1301, USA.
 #
 
+from __future__ import print_function
+
 from gnuradio import gr, blocks
 from gnuradio.eng_arg import eng_float, intx
 from argparse import ArgumentParser
@@ -30,13 +32,13 @@ try:
     from PyQt4 import QtGui, QtCore
     import sip
 except ImportError:
-    print "Error: Program requires PyQt4 and gr-qtgui."
+    print("Error: Program requires PyQt4 and gr-qtgui.")
     sys.exit(1)
 
 try:
     import scipy
 except ImportError:
-    print "Error: Scipy required (www.scipy.org)."
+    print("Error: Scipy required (www.scipy.org).")
     sys.exit(1)
 
 try:
diff --git a/gr-qtgui/apps/plot_spectrogram_form.py 
b/gr-qtgui/apps/plot_spectrogram_form.py
index 17cb033..177d7a1 100644
--- a/gr-qtgui/apps/plot_spectrogram_form.py
+++ b/gr-qtgui/apps/plot_spectrogram_form.py
@@ -20,6 +20,8 @@
 # Boston, MA 02110-1301, USA.
 #
 
+from __future__ import print_function
+
 import sys
 from gnuradio import filter
 
@@ -27,7 +29,7 @@ try:
     from PyQt4 import QtGui, QtCore
     import sip
 except ImportError:
-    print "Error: Program requires PyQt4."
+    print("Error: Program requires PyQt4.")
     sys.exit(1)
 
 try:
diff --git a/gr-qtgui/apps/plot_time_base.py b/gr-qtgui/apps/plot_time_base.py
index cfbe5dc..3799d41 100644
--- a/gr-qtgui/apps/plot_time_base.py
+++ b/gr-qtgui/apps/plot_time_base.py
@@ -20,6 +20,8 @@
 # Boston, MA 02110-1301, USA.
 #
 
+from __future__ import print_function
+
 from gnuradio import gr, blocks
 from gnuradio.eng_arg import eng_float, intx
 from argparse import ArgumentParser
@@ -30,13 +32,13 @@ try:
     from PyQt4 import QtGui, QtCore
     import sip
 except ImportError:
-    print "Error: Program requires PyQt4 and gr-qtgui."
+    print("Error: Program requires PyQt4 and gr-qtgui.")
     sys.exit(1)
 
 try:
     import scipy
 except ImportError:
-    print "Error: Scipy required (www.scipy.org)."
+    print("Error: Scipy required (www.scipy.org).")
     sys.exit(1)
 
 try:
diff --git a/gr-qtgui/apps/plot_time_form.py b/gr-qtgui/apps/plot_time_form.py
index 0ab94e6..7b296f9 100644
--- a/gr-qtgui/apps/plot_time_form.py
+++ b/gr-qtgui/apps/plot_time_form.py
@@ -20,6 +20,8 @@
 # Boston, MA 02110-1301, USA.
 #
 
+from __future__ import print_function
+
 import sys
 from gnuradio import filter
 
@@ -27,7 +29,7 @@ try:
     from PyQt4 import QtGui, QtCore
     import sip
 except ImportError:
-    print "Error: Program requires PyQt4."
+    print("Error: Program requires PyQt4.")
     sys.exit(1)
 
 try:
diff --git a/gr-qtgui/apps/plot_time_raster_base.py 
b/gr-qtgui/apps/plot_time_raster_base.py
index e84b84c..17cecc3 100644
--- a/gr-qtgui/apps/plot_time_raster_base.py
+++ b/gr-qtgui/apps/plot_time_raster_base.py
@@ -20,6 +20,8 @@
 # Boston, MA 02110-1301, USA.
 #
 
+from __future__ import print_function
+
 from gnuradio import gr, blocks
 from gnuradio.eng_arg import eng_float, intx
 from argparse import ArgumentParser
@@ -30,13 +32,13 @@ try:
     from PyQt4 import QtGui, QtCore
     import sip
 except ImportError:
-    print "Error: Program requires PyQt4 and gr-qtgui."
+    print("Error: Program requires PyQt4 and gr-qtgui.")
     sys.exit(1)
 
 try:
     import scipy
 except ImportError:
-    print "Error: Scipy required (www.scipy.org)."
+    print("Error: Scipy required (www.scipy.org).")
     sys.exit(1)
 
 try:
diff --git a/gr-qtgui/apps/plot_time_raster_form.py 
b/gr-qtgui/apps/plot_time_raster_form.py
index 32fbba0..7ddacf6 100644
--- a/gr-qtgui/apps/plot_time_raster_form.py
+++ b/gr-qtgui/apps/plot_time_raster_form.py
@@ -20,6 +20,8 @@
 # Boston, MA 02110-1301, USA.
 #
 
+from __future__ import print_function
+
 import sys, math
 from gnuradio import filter
 
@@ -27,7 +29,7 @@ try:
     from PyQt4 import QtGui, QtCore
     import sip
 except ImportError:
-    print "Error: Program requires PyQt4."
+    print("Error: Program requires PyQt4.")
     sys.exit(1)
 
 try:
@@ -153,5 +155,3 @@ class plot_time_raster_form(plot_form):
 
         nsamps = int(math.ceil(self.top_block._ncols*(n+1)))
         self.top_block.reset(self._start, nsamps)
-
-
diff --git a/gr-qtgui/python/qtgui/util.py.cmakein 
b/gr-qtgui/python/qtgui/util.py.cmakein
index ec654d9..4014fc1 100644
--- a/gr-qtgui/python/qtgui/util.py.cmakein
+++ b/gr-qtgui/python/qtgui/util.py.cmakein
@@ -21,7 +21,10 @@
 # Boston, MA 02110-1301, USA.
 #
 
+from __future__ import print_function
+
 @PY_QT_IMPORT@
+
 from gnuradio import gr
 
 def check_set_qss():
@@ -31,4 +34,4 @@ def check_set_qss():
         try:
             app.setStyleSheet(open(qssfile).read())
         except:
-            print "WARNING: bad QSS file, %s"%(qssfile)
+            print("WARNING: bad QSS file, %s"%(qssfile))



reply via email to

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