summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosh Blum2011-09-20 16:05:53 -0700
committerJosh Blum2011-09-24 10:26:20 -0700
commit40193f0b6ca030db990ec98a3b5059e918f7aaf3 (patch)
treed3f5f6dbce9be536151d939e41718bd3e91e1ef5
parentc825caf1a86c5cefd20fdd222d915011ef43fbae (diff)
downloadgnuradio-40193f0b6ca030db990ec98a3b5059e918f7aaf3.tar.gz
gnuradio-40193f0b6ca030db990ec98a3b5059e918f7aaf3.tar.bz2
gnuradio-40193f0b6ca030db990ec98a3b5059e918f7aaf3.zip
uhd: added kwargs to construct individual struct elements in tune_request_t
-rw-r--r--gr-uhd/swig/__init__.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/gr-uhd/swig/__init__.py b/gr-uhd/swig/__init__.py
index 5c0c011b7..1f82b4a26 100644
--- a/gr-uhd/swig/__init__.py
+++ b/gr-uhd/swig/__init__.py
@@ -32,9 +32,13 @@ def _prepare_uhd_swig():
#Make the python tune request object inherit from float
#so that it can be passed in GRC as a frequency parameter.
#The type checking in GRC will accept the tune request.
+ #Also use kwargs to construct individual struct elements.
class tune_request_t(uhd_swig.tune_request_t, float):
- def __new__(self, *args): return float.__new__(self)
+ def __new__(self, *args, **kwargs): return float.__new__(self)
def __float__(self): return self.target_freq
+ def __init__(self, *args, **kwargs):
+ super(tune_request_t, self).__init__(*args)
+ for key, val in kwargs.iteritems(): setattr(self, key, val)
setattr(uhd_swig, 'tune_request_t', tune_request_t)
#Make the python tune request object inherit from string