Piotr Krysik | ea34c01 | 2016-10-02 18:53:43 +0200 | [diff] [blame] | 1 | #!/usr/bin/env python2 |
| 2 | # -*- coding: utf-8 -*- |
| 3 | # @file |
Piotr Krysik | a6268a5 | 2017-08-23 16:02:19 +0200 | [diff] [blame] | 4 | # @author (C) 2016 by Piotr Krysik <ptrkrysik@gmail.com> |
Piotr Krysik | ea34c01 | 2016-10-02 18:53:43 +0200 | [diff] [blame] | 5 | # @section LICENSE |
| 6 | # |
| 7 | # Gr-gsm is free software; you can redistribute it and/or modify |
| 8 | # it under the terms of the GNU General Public License as published by |
| 9 | # the Free Software Foundation; either version 3, or (at your option) |
| 10 | # any later version. |
| 11 | # |
| 12 | # Gr-gsm is distributed in the hope that it will be useful, |
| 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 | # GNU General Public License for more details. |
| 16 | # |
| 17 | # You should have received a copy of the GNU General Public License |
| 18 | # along with gr-gsm; see the file COPYING. If not, write to |
| 19 | # the Free Software Foundation, Inc., 51 Franklin Street, |
| 20 | # Boston, MA 02110-1301, USA. |
| 21 | # |
| 22 | |
Piotr Krysik | 8715da0 | 2016-01-06 22:21:09 +0100 | [diff] [blame] | 23 | from gnuradio import gr |
| 24 | from distutils.version import LooseVersion as version |
| 25 | |
| 26 | #class created to solve incompatibility of reginstration of message inputs |
| 27 | #that was introduced in gnuradio 3.7.9 |
| 28 | |
| 29 | class hier_block(gr.hier_block2): |
| 30 | def message_port_register_hier_in(self, port_id): |
| 31 | if version(gr.version()) >= version('3.7.9'): |
| 32 | super(hier_block, self).message_port_register_hier_in(port_id) |
| 33 | else: |
| 34 | super(hier_block, self).message_port_register_hier_out(port_id) |
| 35 | |
| 36 | def message_port_register_hier_out(self, port_id): |
| 37 | if version(gr.version()) >= version('3.7.9'): |
| 38 | super(hier_block, self).message_port_register_hier_out(port_id) |
| 39 | else: |
| 40 | super(hier_block, self).message_port_register_hier_in(port_id) |
| 41 | |