diff options
author | Tom Rondeau <trondeau@vt.edu> | 2011-09-26 13:20:09 -0400 |
---|---|---|
committer | Tom Rondeau <trondeau@vt.edu> | 2011-09-26 13:20:09 -0400 |
commit | 18201a678610a608a4c952122ce6dc9430e8e2d1 (patch) | |
tree | f580ed94541f53fd86c99922708cf5367c972513 /gr-uhd/swig | |
parent | dc88c64b25bf4c4f28e1e0097c8c579b36e3a079 (diff) | |
parent | dd63208289584f764ad69f36fbd552def3c761e5 (diff) |
Merge branch 'master' into next
Diffstat (limited to 'gr-uhd/swig')
-rw-r--r-- | gr-uhd/swig/__init__.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gr-uhd/swig/__init__.py b/gr-uhd/swig/__init__.py index 5c0c011b75..1f82b4a26b 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 |