diff options
author | Ben Reynwar <ben@reynwar.net> | 2013-06-03 14:48:01 -0700 |
---|---|---|
committer | Ben Reynwar <ben@reynwar.net> | 2013-06-03 14:48:01 -0700 |
commit | 2221545bed592dbd0c22f8c5745c9dcfad2f0480 (patch) | |
tree | ff2cfc21e281c9005cf916e07c51581e02928473 /gnuradio-runtime | |
parent | 6ee7c1a6267e823d5525d3d5cf251ba52b12c823 (diff) |
channels: Setting up channels module for uninstalled import.
Diffstat (limited to 'gnuradio-runtime')
-rw-r--r-- | gnuradio-runtime/python/gnuradio/__init__.py | 1 | ||||
-rw-r--r-- | gnuradio-runtime/python/gnuradio/gr/CMakeLists.txt | 1 | ||||
-rw-r--r-- | gnuradio-runtime/python/gnuradio/gr/__init__.py | 31 | ||||
-rw-r--r-- | gnuradio-runtime/python/gnuradio/gr/tag_utils.py | 53 |
4 files changed, 31 insertions, 55 deletions
diff --git a/gnuradio-runtime/python/gnuradio/__init__.py b/gnuradio-runtime/python/gnuradio/__init__.py index c0274656d1..6494974fcd 100644 --- a/gnuradio-runtime/python/gnuradio/__init__.py +++ b/gnuradio-runtime/python/gnuradio/__init__.py @@ -44,3 +44,4 @@ if path.endswith(path_ending): __path__.append(os.path.join(build_path, 'gr-vocoder', 'python')) __path__.append(os.path.join(build_path, 'gr-fcd', 'python')) __path__.append(os.path.join(build_path, 'gr-comedi', 'python')) + __path__.append(os.path.join(build_path, 'gr-channels', 'python')) diff --git a/gnuradio-runtime/python/gnuradio/gr/CMakeLists.txt b/gnuradio-runtime/python/gnuradio/gr/CMakeLists.txt index 7f9c19500b..c29ea5df93 100644 --- a/gnuradio-runtime/python/gnuradio/gr/CMakeLists.txt +++ b/gnuradio-runtime/python/gnuradio/gr/CMakeLists.txt @@ -27,7 +27,6 @@ GR_PYTHON_INSTALL(FILES gr_threading_23.py gr_threading_24.py hier_block2.py - tag_utils.py top_block.py pubsub.py DESTINATION ${GR_PYTHON_DIR}/gnuradio/gr diff --git a/gnuradio-runtime/python/gnuradio/gr/__init__.py b/gnuradio-runtime/python/gnuradio/gr/__init__.py index 94a5c9ec2b..7ceefb27a5 100644 --- a/gnuradio-runtime/python/gnuradio/gr/__init__.py +++ b/gnuradio-runtime/python/gnuradio/gr/__init__.py @@ -43,8 +43,37 @@ except ImportError: from exceptions import * from top_block import * from hier_block2 import * -from tag_utils import * +#from tag_utils import * from gateway import basic_block, sync_block, decim_block, interp_block # Force the preference database to be initialized prefs = prefs.singleton + + +class PythonTag(object): + " Python container for tags " + def __init__(self): + self.offset = None + self.key = None + self.value = None + self.srcid = None + +def tag_to_python(tag): + """ Convert a stream tag to a Python-readable object """ + newtag = PythonTag() + newtag.offset = tag.offset + newtag.key = pmt.to_python(tag.key) + newtag.value = pmt.to_python(tag.value) + newtag.srcid = pmt.to_python(tag.srcid) + return newtag + +def tag_to_pmt(tag): + """ Convert a Python-readable object to a stream tag """ + newtag = gr.tag_t() + newtag.offset = tag.offset + newtag.key = pmt.to_python(tag.key) + newtag.value = pmt.from_python(tag.value) + newtag.srcid = pmt.from_python(tag.srcid) + return newtag + + diff --git a/gnuradio-runtime/python/gnuradio/gr/tag_utils.py b/gnuradio-runtime/python/gnuradio/gr/tag_utils.py deleted file mode 100644 index c25ed8d772..0000000000 --- a/gnuradio-runtime/python/gnuradio/gr/tag_utils.py +++ /dev/null @@ -1,53 +0,0 @@ -# -# Copyright 2003-2012 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# -""" Conversion tools between stream tags and Python objects """ - -import pmt - -from gnuradio import gr - -class PythonTag(object): - " Python container for tags " - def __init__(self): - self.offset = None - self.key = None - self.value = None - self.srcid = None - -def tag_to_python(tag): - """ Convert a stream tag to a Python-readable object """ - newtag = PythonTag() - newtag.offset = tag.offset - newtag.key = pmt.to_python(tag.key) - newtag.value = pmt.to_python(tag.value) - newtag.srcid = pmt.to_python(tag.srcid) - return newtag - -def tag_to_pmt(tag): - """ Convert a Python-readable object to a stream tag """ - newtag = gr.tag_t() - newtag.offset = tag.offset - newtag.key = pmt.to_python(tag.key) - newtag.value = pmt.from_python(tag.value) - newtag.srcid = pmt.from_python(tag.srcid) - return newtag - - |