diff options
author | Clayton Smith <argilo@gmail.com> | 2020-10-06 22:31:13 -0400 |
---|---|---|
committer | mormj <34754695+mormj@users.noreply.github.com> | 2020-10-20 06:17:14 -0400 |
commit | 0f84fcef36bc52e62a385ed0288d630ec2d3ec77 (patch) | |
tree | 26329e28a86ca02f30389f068dcc596bf260dcfb /gnuradio-runtime/python/gnuradio | |
parent | a1bd12700039ee83bec5fea5ee4f78f01f3562b2 (diff) |
gru: remove unused files
Diffstat (limited to 'gnuradio-runtime/python/gnuradio')
6 files changed, 0 insertions, 164 deletions
diff --git a/gnuradio-runtime/python/gnuradio/gru/CMakeLists.txt b/gnuradio-runtime/python/gnuradio/gru/CMakeLists.txt index ceba6fd6c5..8e6e150bbf 100644 --- a/gnuradio-runtime/python/gnuradio/gru/CMakeLists.txt +++ b/gnuradio-runtime/python/gnuradio/gru/CMakeLists.txt @@ -12,12 +12,8 @@ GR_PYTHON_INSTALL(FILES freqz.py gnuplot_freqz.py hexint.py - listmisc.py mathmisc.py msgq_runner.py - os_read_exactly.py - seq_with_cursor.py - socket_stuff.py daemon.py DESTINATION ${GR_PYTHON_DIR}/gnuradio/gru ) diff --git a/gnuradio-runtime/python/gnuradio/gru/__init__.py b/gnuradio-runtime/python/gnuradio/gru/__init__.py index d3418526a7..a7684b3c5b 100644 --- a/gnuradio-runtime/python/gnuradio/gru/__init__.py +++ b/gnuradio-runtime/python/gnuradio/gru/__init__.py @@ -5,9 +5,5 @@ from .daemon import * from .freqz import * from .gnuplot_freqz import * from .hexint import * -from .listmisc import * from .mathmisc import * from .msgq_runner import * -from .os_read_exactly import * -from .seq_with_cursor import * -from .socket_stuff import * diff --git a/gnuradio-runtime/python/gnuradio/gru/listmisc.py b/gnuradio-runtime/python/gnuradio/gru/listmisc.py deleted file mode 100644 index a504d3ba00..0000000000 --- a/gnuradio-runtime/python/gnuradio/gru/listmisc.py +++ /dev/null @@ -1,17 +0,0 @@ -# -# Copyright 2005 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# SPDX-License-Identifier: GPL-3.0-or-later -# -# - -def list_reverse(x): - """ - Return a copy of x that is reverse order. - """ - r = list(x) - r.reverse() - return r - diff --git a/gnuradio-runtime/python/gnuradio/gru/os_read_exactly.py b/gnuradio-runtime/python/gnuradio/gru/os_read_exactly.py deleted file mode 100644 index da04483388..0000000000 --- a/gnuradio-runtime/python/gnuradio/gru/os_read_exactly.py +++ /dev/null @@ -1,24 +0,0 @@ -# -# Copyright 2005 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# SPDX-License-Identifier: GPL-3.0-or-later -# -# - -import os - -def os_read_exactly(file_descriptor, nbytes): - """ - Replacement for os.read that blocks until it reads exactly nbytes. - - """ - s = '' - while nbytes > 0: - sbuf = os.read(file_descriptor, nbytes) - if not(sbuf): - return '' - nbytes -= len(sbuf) - s = s + sbuf - return s diff --git a/gnuradio-runtime/python/gnuradio/gru/seq_with_cursor.py b/gnuradio-runtime/python/gnuradio/gru/seq_with_cursor.py deleted file mode 100644 index 4d75e023ff..0000000000 --- a/gnuradio-runtime/python/gnuradio/gru/seq_with_cursor.py +++ /dev/null @@ -1,65 +0,0 @@ -# -# Copyright 2003,2004 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# SPDX-License-Identifier: GPL-3.0-or-later -# -# - -# misc utilities - - -import types - - -class seq_with_cursor (object): - __slots__ = [ 'items', 'index' ] - - def __init__ (self, items, initial_index = None, initial_value = None): - assert len (items) > 0, "seq_with_cursor: len (items) == 0" - self.items = items - self.set_index (initial_index) - if initial_value is not None: - self.set_index_by_value(initial_value) - - def set_index (self, initial_index): - if initial_index is None: - self.index = len (self.items) / 2 - elif initial_index >= 0 and initial_index < len (self.items): - self.index = initial_index - else: - raise ValueError - - def set_index_by_value(self, v): - """ - Set index to the smallest value such that items[index] >= v. - If there is no such item, set index to the maximum value. - """ - self.set_index(0) # side effect! - cv = self.current() - more = True - while cv < v and more: - cv, more = next(self) # side effect! - - def __next__ (self): - new_index = self.index + 1 - if new_index < len (self.items): - self.index = new_index - return self.items[new_index], True - else: - return self.items[self.index], False - - def prev (self): - new_index = self.index - 1 - if new_index >= 0: - self.index = new_index - return self.items[new_index], True - else: - return self.items[self.index], False - - def current (self): - return self.items[self.index] - - def get_seq (self): - return self.items[:] # copy of items diff --git a/gnuradio-runtime/python/gnuradio/gru/socket_stuff.py b/gnuradio-runtime/python/gnuradio/gru/socket_stuff.py deleted file mode 100644 index 4408a13579..0000000000 --- a/gnuradio-runtime/python/gnuradio/gru/socket_stuff.py +++ /dev/null @@ -1,50 +0,0 @@ -# -# Copyright 2005 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# SPDX-License-Identifier: GPL-3.0-or-later -# -# - -# random socket related stuff - -import socket -import os -import sys - -def tcp_connect_or_die(sock_addr): - """ - - Args: - sock_addr: (host, port) to connect to (tuple) - - Returns: - : socket or exits - """ - s = socket.socket (socket.AF_INET, socket.SOCK_STREAM) - try: - s.connect(sock_addr) - except socket.error as err: - sys.stderr.write('Failed to connect to %s: %s\n' % - (sock_addr, os.strerror (err.args[0]),)) - sys.exit(1) - return s - -def udp_connect_or_die(sock_addr): - """ - - Args: - sock_addr: (host, port) to connect to (tuple) - - Returns: - : socket or exits - """ - s = socket.socket (socket.AF_INET, socket.SOCK_DGRAM) - try: - s.connect(sock_addr) - except socket.error as err: - sys.stderr.write('Failed to connect to %s: %s\n' % - (sock_addr, os.strerror (err.args[0]),)) - sys.exit(1) - return s |