2 # Copyright 2008,2009 Free Software Foundation, Inc.
4 # This file is part of GNU Radio
6 # GNU Radio is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 3, or (at your option)
11 # GNU Radio is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License along
17 # with this program; if not, write to the Free Software Foundation, Inc.,
18 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 from gnuradio import gr
22 import gnuradio.gr.gr_threading as _threading
23 from string import split, join, printable
26 def make_trans_table():
35 _trans_table = make_trans_table()
37 def make_printable(s):
38 return s.translate(_trans_table)
41 class queue_runner(_threading.Thread):
42 def __init__(self, msgq):
43 _threading.Thread.__init__(self)
50 msg = self.msgq.delete_head() # Blocking read
54 page = join(split(msg.to_string(), chr(128)), '|')
55 s = make_printable(page)
59 self.msgq.insert_tail(gr.message(1))