diff options
-rw-r--r-- | gr-digital/swig/digital_constellation.i | 17 | ||||
-rw-r--r-- | gr-howto-write-a-block/version.sh | 4 | ||||
-rw-r--r-- | version.sh | 4 |
3 files changed, 21 insertions, 4 deletions
diff --git a/gr-digital/swig/digital_constellation.i b/gr-digital/swig/digital_constellation.i index 7e0ad6afe..acc7aad1a 100644 --- a/gr-digital/swig/digital_constellation.i +++ b/gr-digital/swig/digital_constellation.i @@ -187,3 +187,20 @@ class digital_constellation_8psk : public digital_constellation public: digital_constellation_8psk (); }; + +/* + We want print(constellation) in python to produce nice useful output so + we include code at the end of the generated python file that overrides + the SWIG-generated __repr__ method. + */ +%pythoncode %{ + +digital_constellation_calcdist_sptr.__repr__ = lambda self: '<constellation calcdist (m=%s)>' % str(len(self.points())) +digital_constellation_rect_sptr.__repr__ = lambda self: '<constellation rect (m=%s)>' % str(len(self.points())) +digital_constellation_psk_sptr.__repr__ = lambda self: '<constellation psk (m=%s)>' % str(len(self.points())) +digital_constellation_bpsk_sptr.__repr__ = lambda self: '<constellation bpsk>' +digital_constellation_qpsk_sptr.__repr__ = lambda self: '<constellation qpsk>' +digital_constellation_dqpsk_sptr.__repr__ = lambda self: '<constellation dqpsk>' +digital_constellation_8psk_sptr.__repr__ = lambda self: '<constellation 8psk>' + +%} diff --git a/gr-howto-write-a-block/version.sh b/gr-howto-write-a-block/version.sh index 194150c0f..69c2462cc 100644 --- a/gr-howto-write-a-block/version.sh +++ b/gr-howto-write-a-block/version.sh @@ -1,4 +1,4 @@ MAJOR_VERSION=3 API_COMPAT=5 -MINOR_VERSION=2 -MAINT_VERSION=0 +MINOR_VERSION=3 +MAINT_VERSION=git diff --git a/version.sh b/version.sh index 194150c0f..69c2462cc 100644 --- a/version.sh +++ b/version.sh @@ -1,4 +1,4 @@ MAJOR_VERSION=3 API_COMPAT=5 -MINOR_VERSION=2 -MAINT_VERSION=0 +MINOR_VERSION=3 +MAINT_VERSION=git |